-
Notifications
You must be signed in to change notification settings - Fork 0
73 lines (73 loc) · 3.13 KB
/
android.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
on:
workflow_dispatch:
push:
jobs:
build:
runs-on: ubuntu-latest
name: Build the project
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
steps:
- name: Checkout
uses: actions/checkout@v4
- uses: FranzDiebold/[email protected]
- name: Setup java
uses: actions/setup-java@v3
with:
distribution: "zulu"
java-version: "17"
- name: Set up node
# ADD YOUR CUSTOM DEPENDENCY UPGRADE COMMANDS BELOW
uses: actions/setup-node@v3
with:
node-version: "20"
- name: Load secret
uses: 1password/load-secrets-action@v1
with:
# Export loaded secrets as environment variables
export-env: true
env:
OP_SERVICE_ACCOUNT_TOKEN: ${{ secrets.OP_SERVICE_ACCOUNT_TOKEN }}
AWS_KEY_ID: "op://DevOps/cloudflare-r2-token/access-key-id"
AWS_SECRET_ACCESS_KEY: "op://DevOps/cloudflare-r2-token/secret-access-key"
KEYSTORE: "op://DevOps/dot-android-keystore/base64-encoded-jks"
KEYSTORE_PASSWORD: "op://DevOps/dot-android-keystore/storePassword"
KEY_ALIAS: "op://DevOps/dot-android-keystore/alias"
ENDPOINT: "op://DevOps/cloudflare-r2-token/endpoint"
VITE_BC_ACCOUNT_ID: "op://DevOps/dot-mobile-env-vars/bc-account-id"
VITE_POLICY_KEY: "op://DevOps/dot-mobile-env-vars/policy-key"
- name: Extract Android signing key from env
run: |
echo "${{ env.KEYSTORE }}" > android/release.jks.base64
base64 -d android/release.jks.base64 > android/release.decrypted.jks
- name:
Install JS dependencies and build
# ADD YOUR CUSTOM DEPENDENCY UPGRADE COMMANDS BELOW
run: |
npm ci && npm run build-android
env:
VITE_POLICY_KEY: ${{ env.VITE_POLICY_KEY }}
VITE_BC_ACCOUNT_ID: ${{ env.VITE_BC_ACCOUNT_ID }}
- name: Get current date
id: date
run: echo "date=$(date +'%Y-%m-%d')" >> "$GITHUB_OUTPUT"
- name: Build app bundle
run: cd android && ./gradlew bundle assembleDebug
- name: make output dir
run: mkdir ./outputs
- name: Sign dev build aab
run: jarsigner -keystore android/release.decrypted.jks -storepass "${{ env.KEYSTORE_PASSWORD }}" -signedjar ./outputs/app-release-signed.aab ./android/app/build/outputs/bundle/release/app-release.aab "${{env.KEY_ALIAS}}"
- name: Move apk to outputs folder too
run: cp ./android/app/build/outputs/apk/debug/app-debug.apk ./outputs
- name: set s3 destination_dir for nightly-builds
run: echo "CURRENT_S3_DESTINATION=$CI_REPOSITORY_OWNER/$CI_REPOSITORY_NAME/$CI_REF_NAME_SLUG/$CI_RUN_NUMBER" >> $GITHUB_ENV
- name: Upload Android to R2
uses: shallwefootball/s3-upload-action@master
with:
aws_key_id: ${{ env.AWS_KEY_ID }}
aws_secret_access_key: ${{ env.AWS_SECRET_ACCESS_KEY}}
aws_bucket: dot-mobile
source_dir: "./outputs"
destination_dir: ${{ env.CURRENT_S3_DESTINATION }}
endpoint: ${{ env.ENDPOINT }}