-
Notifications
You must be signed in to change notification settings - Fork 26
107 lines (105 loc) · 4.17 KB
/
build-develop-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
106
107
name: "Develop build"
on:
push:
branches:
- develop
merge_group:
types: [ checks_requested ]
branches: [ develop ]
pull_request:
branches:
- develop
types: [ opened, synchronize ]
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.event.merge_group.head_sha }}
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: 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 debug Keystore
env:
ENCODED_STRING: ${{ secrets.ENCODED_KEYSTORE_DEBUG }}
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 dev flavour
run:
./gradlew app:assembleDevDebug
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_DEBUG: ${{ secrets.SIGNING_KEY_ALIAS_DEBUG }}
KEYPWD_DEBUG: ${{ secrets.SIGNING_KEY_PASSWORD_DEBUG }}
KEYSTOREPWD_DEBUG: ${{ secrets.SIGNING_STORE_PASSWORD_DEBUG }}
ENABLE_SIGNING: ${{ secrets.ENABLE_SIGNING }}
- name: Decode compat Keystore
env:
ENCODED_STRING: ${{ secrets.ENCODED_KEYSTORE_INTERNAL_RELEASE }}
run: |
TMP_KEYSTORE_FILE_PATH="${RUNNER_TEMP}"/keystore
echo $ENCODED_STRING | base64 -di > "${TMP_KEYSTORE_FILE_PATH}"/the.keystore
- name: build staging flavour
run:
./gradlew app:assembleStagingCompat
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_COMPAT: ${{ secrets.SIGNING_KEY_ALIAS_INTERNAL_RELEASE }}
KEYPWD_COMPAT: ${{ secrets.SIGNING_KEY_PASSWORD_INTERNAL_RELEASE }}
KEYSTOREPWD_COMPAT: ${{ secrets.SIGNING_STORE_PASSWORD_INTERNAL_RELEASE }}
ENABLE_SIGNING: ${{ secrets.ENABLE_SIGNING }}
- name: Upload
if: success()
uses: actions/upload-artifact@v4
with:
name: Build Artifacts
path: app/build/outputs/
- name: Deploy StagingCompat 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: staging
build-variant: compat
- name: Deploy DevDebug 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: dev
build-variant: debug