-
Notifications
You must be signed in to change notification settings - Fork 9
152 lines (143 loc) · 5.84 KB
/
android-deploy.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
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
name: 'Android Verifier Deployment'
on:
push:
tags:
- android-v*
# Environment variables that are common to
# more than one deployment
env:
STORE_FILE: "${{ github.workspace }}/android/verifier-keystore"
GAPI_FILE_PATH: "${{ github.workspace }}/android/google-api.json"
NDK_VERSION: "21.4.7075529" #make sure this will map to ndkVersifon in buildGradle
jobs:
publishAndroidDev:
timeout-minutes: 60
if: contains(github.ref, 'release-dev')
name: 'Build and Publish VerifierDev Bundle'
runs-on: ubuntu-latest
env:
STORE_PASSWORD: "${{secrets.DEV_STORE_PASSWORD}}"
KEY_PASSWORD: "${{secrets.DEV_KEY_PASSWORD}}"
KEY_ALIAS: "${{secrets.DEV_KEY_ALIAS}}"
steps:
- name: 'Checkout to branch'
uses: actions/checkout@v2
- name: 'Get release tag'
id: release
run: echo "::set-output name=tag::$(echo ${GITHUB_REF##*/})"
- name: 'Create env file'
run: |
echo "${{ secrets.DEV_BUILD_CONFIG }}" >> .env.staging
- name: 'Create google api file'
run: |
echo "${{ secrets.DEV_GCP_CREDS }}" > ${GAPI_FILE_PATH}.asc
gpg --decrypt --passphrase "${{ secrets.DEV_GPG_PASSPHRASE }}" --batch ${GAPI_FILE_PATH}.asc > ${GAPI_FILE_PATH}
- name: Install npm dependencies
run: |
npm install
# npx react-native bundle --platform android --dev false --entry-file index.js --bundle-output android/app/src/main/assets/index.an
# - name: Install google play dependencies
# run: |
# npx tsc tools/deploy/android/publisher.ts 2>/dev/null
- name: set up JDK 11
uses: actions/setup-java@v2
with:
distribution: 'zulu'
java-version: '11'
- name: Install NDK
run: echo "y" | sudo ${ANDROID_HOME}/tools/bin/sdkmanager --install "ndk;${NDK_VERSION}"
- name: Cache Gradle Wrapper
uses: actions/cache@v2
with:
path: ~/.gradle/wrapper
key: ${{ runner.os }}-gradle-wrapper-${{ hashFiles('gradle/wrapper/gradle-wrapper.properties') }}
- name: Cache Gradle Dependencies
uses: actions/cache@v2
with:
path: ~/.gradle/caches
key: ${{ runner.os }}-gradle-caches-${{ hashFiles('gradle/wrapper/gradle-wrapper.properties') }}
restore-keys: |
${{ runner.os }}-gradle-caches-
- name: Make Gradlew Executable
run: cd android && chmod +x ./gradlew
- name: 'Decrypt keystore and GCP credentials'
working-directory: ./android
run: |
echo "${{ secrets.DEV_KEYSTORE }}" > verifier-keystore.asc
gpg --decrypt --passphrase "${{ secrets.DEV_GPG_PASSPHRASE }}" --batch verifier-keystore.asc > verifier-keystore
touch local.properties
- name: 'Build devRelease'
working-directory: ./android
run: ./gradlew :app:bundleDevRelease --no-daemon --info
- name: 'Publish to the store'
run: >
node tools/deploy/android/androidDeploy.js
--googleApiKeyFilePath ${GAPI_FILE_PATH}
--aabFilePath ./android/app/build/outputs/bundle/devRelease/app-dev-release.aab
--env dev
--status draft
publishAndroidProd:
timeout-minutes: 60
if: contains(github.ref, 'release-prod')
name: 'Build and Publish Verifier Bundle'
runs-on: ubuntu-latest
env:
STORE_PASSWORD: "${{secrets.PROD_STORE_PASSWORD}}"
KEY_PASSWORD: "${{secrets.PROD_KEY_PASSWORD}}"
KEY_ALIAS: "${{secrets.PROD_KEY_ALIAS}}"
steps:
- name: 'Checkout to branch'
uses: actions/checkout@v2
- name: 'Get release tag'
id: release
run: echo "::set-output name=tag::$(echo ${GITHUB_REF##*/})"
- name: 'Create env file'
run: |
echo "${{ secrets.PROD_BUILD_CONFIG }}" >> .env.production
- name: 'Create google api file'
run: |
echo "${{ secrets.PROD_GCP_CREDS }}" > ${GAPI_FILE_PATH}.asc
gpg --decrypt --passphrase "${{ secrets.PROD_GPG_PASSPHRASE }}" --batch ${GAPI_FILE_PATH}.asc > ${GAPI_FILE_PATH}
- name: Install npm dependencies
run: |
npm install
# - name: Install google play dependencies
# run: |
# npx tsc tools/deploy/android/publisher.ts 2>/dev/null
- name: set up JDK 11
uses: actions/setup-java@v2
with:
distribution: 'zulu'
java-version: '11'
- name: Install NDK
run: echo "y" | sudo ${ANDROID_HOME}/tools/bin/sdkmanager --install "ndk;${NDK_VERSION}"
- name: Cache Gradle Wrapper
uses: actions/cache@v2
with:
path: ~/.gradle/wrapper
key: ${{ runner.os }}-gradle-wrapper-${{ hashFiles('gradle/wrapper/gradle-wrapper.properties') }}
- name: Cache Gradle Dependencies
uses: actions/cache@v2
with:
path: ~/.gradle/caches
key: ${{ runner.os }}-gradle-caches-${{ hashFiles('gradle/wrapper/gradle-wrapper.properties') }}
restore-keys: |
${{ runner.os }}-gradle-caches-
- name: Make Gradlew Executable
run: cd android && chmod +x ./gradlew
- name: 'Decrypt keystore and GCP credentials'
working-directory: ./android
run: |
echo "${{ secrets.PROD_KEYSTORE }}" > verifier-keystore.asc
gpg --decrypt --passphrase "${{ secrets.PROD_GPG_PASSPHRASE }}" --batch verifier-keystore.asc > verifier-keystore
touch local.properties
- name: 'Build prodRelease'
working-directory: ./android
run: ./gradlew :app:bundleProdRelease --no-daemon --info
- name: 'Publish to the store'
run: >
node tools/deploy/android/androidDeploy.js
--googleApiKeyFilePath ${GAPI_FILE_PATH}
--aabFilePath ./android/app/build/outputs/bundle/prodRelease/app-prod-release.aab
--env prod
--status draft