-
Notifications
You must be signed in to change notification settings - Fork 26
105 lines (102 loc) · 4.07 KB
/
build-beta-app.yml
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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
name: "Beta build"
on:
push:
branches:
- main
pull_request:
branches:
- main
workflow_call:
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
code-analysis:
uses: ./.github/workflows/code-analysis.yml
ui-tests:
uses: ./.github/workflows/gradle-run-ui-tests.yml
unit-tests:
uses: ./.github/workflows/gradle-run-unit-tests.yml
secrets: inherit
build-app:
needs: [ code-analysis, ui-tests, unit-tests ]
runs-on: ubuntu-latest
steps:
- name: Check if triggered by a pull request or non-main branch
run: |
if [[ "${{ github.event_name }}" == "pull_request" || "${{ github.ref }}" != "refs/heads/main" ]]; then
echo "This workflow should only run on pushes to the main branch.";
exit 1;
fi
- name: Checkout
uses: actions/checkout@v4
with:
submodules: recursive # Needed in order to fetch Kalium sources for building
fetch-depth: 0
- name: Set up JDK 17
uses: buildjet/setup-java@v4
with:
java-version: '17'
distribution: 'temurin'
cache: gradle
- name: Decode Keystore
env:
ENCODED_STRING: ${{ secrets.ENCODED_KEYSTORE_PRE_RELEASE }}
run: |
TMP_KEYSTORE_FILE_PATH="${RUNNER_TEMP}"/keystore
mkdir "${TMP_KEYSTORE_FILE_PATH}"
echo $ENCODED_STRING | base64 -di > "${TMP_KEYSTORE_FILE_PATH}"/the.keystore
- name: Make gradlew executable
run: chmod +x ./gradlew
- name: Build beta flavour APK
run:
./gradlew app:assembleBetaRelease
env:
DATADOG_APP_ID: ${{ secrets.DATADOG_APP_ID }}
DATADOG_CLIENT_TOKEN: ${{ secrets.DATADOG_CLIENT_TOKEN }}
KEYSTORE_FILE_PATH_DEBUG: ${{ vars.KEYSTORE_FILE_PATH }}
KEYSTORE_FILE_PATH_RELEASE: ${{ vars.KEYSTORE_FILE_PATH }}
KEYSTORE_FILE_PATH_COMPAT: ${{ vars.KEYSTORE_FILE_PATH }}
KEYSTORE_FILE_PATH_COMPAT_RELEASE: ${{ vars.KEYSTORE_FILE_PATH }}
KEYSTORE_KEY_NAME_RELEASE: ${{ secrets.SIGNING_KEY_ALIAS_PRE_RELEASE }}
KEYPWD_RELEASE: ${{ secrets.SIGNING_KEY_PASSWORD_PRE_RELEASE }}
KEYSTOREPWD_RELEASE: ${{ secrets.SIGNING_STORE_PASSWORD_PRE_RELEASE }}
ENABLE_SIGNING: ${{ secrets.ENABLE_SIGNING }}
- name: Build beta flavour Bundle
run:
./gradlew app:bundleBetaRelease
env:
DATADOG_APP_ID: ${{ secrets.DATADOG_APP_ID }}
DATADOG_CLIENT_TOKEN: ${{ secrets.DATADOG_CLIENT_TOKEN }}
KEYSTORE_FILE_PATH_DEBUG: ${{ vars.KEYSTORE_FILE_PATH }}
KEYSTORE_FILE_PATH_RELEASE: ${{ vars.KEYSTORE_FILE_PATH }}
KEYSTORE_FILE_PATH_COMPAT: ${{ vars.KEYSTORE_FILE_PATH }}
KEYSTORE_FILE_PATH_COMPAT_RELEASE: ${{ vars.KEYSTORE_FILE_PATH }}
KEYSTORE_KEY_NAME_RELEASE: ${{ secrets.SIGNING_KEY_ALIAS_PRE_RELEASE }}
KEYPWD_RELEASE: ${{ secrets.SIGNING_KEY_PASSWORD_PRE_RELEASE }}
KEYSTOREPWD_RELEASE: ${{ secrets.SIGNING_STORE_PASSWORD_PRE_RELEASE }}
ENABLE_SIGNING: ${{ secrets.ENABLE_SIGNING }}
- name: Upload
if: success()
uses: actions/upload-artifact@v4
with:
name: Build Artifacts
path: app/build/outputs/
- name: Create service_account.json
run: echo '${{ secrets.SERVICE_ACCOUNT_JSON }}' > service_account.json
- name: Deploy to internal track
uses: r0adkll/upload-google-play@v1
with:
serviceAccountJson: service_account.json
packageName: com.wire.android.internal
releaseFiles: app/build/outputs/bundle/betaRelease/*.aab
track: internal
- name: Deploy BetaRelease to S3
uses: ./.github/actions/deploy-to-s3
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-bucket: ${{ secrets.AWS_S3_BUCKET }}
github-token: ${{ secrets.GITHUB_TOKEN }}
build-flavour: beta
build-variant: release