-
Notifications
You must be signed in to change notification settings - Fork 21
57 lines (50 loc) · 2.41 KB
/
todoapp_build_and_deploy_app.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
name: "Build and deploy TodoApp app"
on:
push:
tags:
- 'todoapp-*-v[0-9]+.[0-9]+.[0-9]+\+[0-9]+' # Example: todoapp-production-v1.2.3+45
jobs:
app_version_extraction:
runs-on: ubuntu-latest
steps:
- name: Extract build name and number from tag
id: extraction
run: |
TAGNAME=$(echo "${GITHUB_REF#refs/tags/*}")
VERSION=$(echo $TAGNAME | rev | cut -d "v" -f 1 | rev)
BUILD_NAME=$(echo $VERSION | cut -d "+" -f 1)
BUILD_NUMBER=$(echo $VERSION | cut -d "+" -f 2-)
NAMEWITHENV=$(echo $TAGNAME | rev | cut -d "-" -f 2- | rev)
FLAVOR=$(echo $NAMEWITHENV | rev | cut -d "-" -f 1 | rev)
# Export the variables, so they are visible in other jobs
echo "build_name=${BUILD_NAME}" >> $GITHUB_OUTPUT
echo "build_number=${BUILD_NUMBER}" >> $GITHUB_OUTPUT
echo "flavor=${FLAVOR}" >> $GITHUB_OUTPUT
outputs:
build_name: ${{ steps.extraction.outputs.build_name }}
build_number: ${{ steps.extraction.outputs.build_number }}
flavor: ${{ steps.extraction.outputs.flavor }}
build_and_deploy_android:
needs: app_version_extraction
uses: ./.github/workflows/fastlane_build_and_deploy_android_app.yaml
with:
project_path: "examples/todoapp"
build_name: ${{ needs.app_version_extraction.outputs.build_name }}
build_number: ${{ needs.app_version_extraction.outputs.build_number }}
flavor: ${{ needs.app_version_extraction.outputs.flavor }}
publish_to_store: true
secrets:
credential_encryption_password: ${{ secrets.TODOAPP_MOBILE_DISTRIBUTION_ENCRYPTION_PASSWORD }}
credential_repository_access_secret: ${{ secrets.TODOAPP_MOBILE_DISTRIBUTION_REPOSITORY_ACCESS_SECRET }}
build_and_deploy_ios:
needs: app_version_extraction
uses: ./.github/workflows/fastlane_build_and_deploy_ios_app.yaml
with:
project_path: "examples/todoapp"
build_name: ${{ needs.app_version_extraction.outputs.build_name }}
build_number: ${{ needs.app_version_extraction.outputs.build_number }}
flavor: ${{ needs.app_version_extraction.outputs.flavor }}
publish_to_store: true
secrets:
credential_encryption_password: ${{ secrets.TODOAPP_MOBILE_DISTRIBUTION_ENCRYPTION_PASSWORD }}
credential_repository_access_secret: ${{ secrets.TODOAPP_MOBILE_DISTRIBUTION_REPOSITORY_ACCESS_SECRET }}