Skip to content

Commit 3dc9504

Browse files
feat: Android release process (#1779)
* release flow work in progress * fix current task description * release flow updated to what it probably should be * keys passed * yaml error fix * yaml error fix 2 * yaml error fix 3 * yaml error fix 4 not relevant * test workflow changes * test workflow changes 2 * workflow descriptions update * renamed jobs * unblock push to store step for test * added cache back and jobs renamed * publish to fix testing * publish to fix 2 * publish to fix 3 * publish to fix 4 * publish to fix 5 * version update to see if we can upload to play store * cleanup release flow after testing of release flow * readme updated about release * review changes * readme updated * updated checkout action version as in other flows * chore: update android existing CI flow --------- Co-authored-by: Krzysztof Rodak <krzysztof@parity.io>
1 parent ee7eea7 commit 3dc9504

File tree

3 files changed

+177
-2
lines changed

3 files changed

+177
-2
lines changed

.github/workflows/android-app.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ on:
77
- master
88
- stable
99
jobs:
10+
#this it tests jobs, called build as it's required name for PR
1011
build:
1112
name: Build
1213
runs-on: ubuntu-22.04
@@ -72,7 +73,7 @@ jobs:
7273
run: |
7374
./gradlew :android:testDebugUnitTest
7475
75-
debug:
76+
makeapk:
7677
name: Build unsigned APKs
7778
runs-on: ubuntu-22.04
7879
# if: github.ref == ' refs/head/main'
@@ -135,7 +136,7 @@ jobs:
135136
restore-keys: |
136137
${{ runner.os }}-gradle-
137138
138-
- name: Assemble GPlay unsigned apk
139+
- name: Assemble unsigned debug apk
139140
run: |
140141
./gradlew clean assembleDebug --stacktrace
141142

.github/workflows/android-release.yml

Lines changed: 167 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,167 @@
1+
name: Release android app
2+
3+
on:
4+
workflow_dispatch:
5+
jobs:
6+
#it's tests but build job is required in our branch policies
7+
build:
8+
name: Build android unit test
9+
runs-on: ubuntu-22.04
10+
steps:
11+
- name: Cancel Previous Runs
12+
uses: styfle/cancel-workflow-action@b173b6ec0100793626c2d9e6b90435061f4fc3e5 # 0.11.0
13+
with:
14+
access_token: ${{ github.token }}
15+
16+
- name: Checkout Sources
17+
uses: actions/checkout@v3.5.0
18+
with:
19+
fetch-depth: 50
20+
submodules: 'recursive'
21+
22+
- name: Install System Dependencies (Linux)
23+
run: |
24+
sudo apt-get update
25+
sudo apt-get install -y clang libclang-dev libopencv-dev
26+
27+
- name: Install Rust stable toolchain
28+
uses: actions-rs/toolchain@v1
29+
with:
30+
profile: minimal
31+
toolchain: stable
32+
override: true
33+
34+
- name: Install uniffi_bindgen
35+
uses: actions-rs/install@v0.1
36+
with:
37+
crate: uniffi_bindgen
38+
version: 0.22.0 # Must be in sync with version in Cargo.toml
39+
use-tool-cache: true
40+
41+
- name: Install additional rust targets
42+
run: rustup target add aarch64-linux-android armv7-linux-androideabi x86_64-linux-android
43+
44+
- name: Set up JDK environment
45+
uses: actions/setup-java@v3
46+
with:
47+
distribution: 'adopt'
48+
java-version: 11
49+
50+
- name: Install NDK
51+
run: echo "y" | sudo ${ANDROID_HOME}/tools/bin/sdkmanager --install "ndk;24.0.8215888" --sdk_root=${ANDROID_SDK_ROOT}
52+
53+
- name: Rust Cache
54+
uses: Swatinem/rust-cache@6fd3edff6979b79f87531400ad694fb7f2c84b1f # v2.2.1
55+
with:
56+
workspaces: rust -> rust/target
57+
58+
- name: Gradle Cache
59+
uses: actions/cache@v3
60+
with:
61+
path: |
62+
~/.gradle/caches
63+
~/.gradle/wrapper
64+
key: ${{ runner.os }}-gradle-${{ hashFiles('**/.gradle*', '**/gradle-wrapper.properties') }}
65+
restore-keys: |
66+
${{ runner.os }}-gradle-
67+
68+
- name: Build
69+
run: |
70+
./gradlew :android:testDebugUnitTest
71+
72+
make:
73+
name: Build signed APKs
74+
runs-on: ubuntu-22.04
75+
# if: github.ref == ' refs/head/main'
76+
steps:
77+
- name: Cancel Previous Runs
78+
uses: styfle/cancel-workflow-action@b173b6ec0100793626c2d9e6b90435061f4fc3e5 # 0.11.0
79+
with:
80+
access_token: ${{ github.token }}
81+
82+
- name: Checkout Sources
83+
uses: actions/checkout@v3.5.1
84+
with:
85+
fetch-depth: 50
86+
submodules: 'recursive'
87+
88+
- name: Install System Dependencies (Linux)
89+
run: |
90+
sudo apt-get update
91+
sudo apt-get install -y clang libclang-dev libopencv-dev
92+
93+
- name: Install Rust stable toolchain
94+
uses: actions-rs/toolchain@v1
95+
with:
96+
profile: minimal
97+
toolchain: stable
98+
override: true
99+
100+
- name: Install uniffi_bindgen
101+
uses: actions-rs/install@v0.1
102+
with:
103+
crate: uniffi_bindgen
104+
version: 0.22.0 # Must be in sync with version in Cargo.toml
105+
use-tool-cache: true
106+
107+
- name: Install additional rust targets
108+
run: rustup target add aarch64-linux-android armv7-linux-androideabi x86_64-linux-android
109+
110+
- name: Set up JDK environment
111+
uses: actions/setup-java@v3
112+
with:
113+
distribution: 'adopt'
114+
java-version: 11
115+
116+
- name: Install NDK
117+
run: echo "y" | sudo ${ANDROID_HOME}/tools/bin/sdkmanager --install "ndk;24.0.8215888" --sdk_root=${ANDROID_SDK_ROOT}
118+
119+
- name: Rust Cache
120+
uses: Swatinem/rust-cache@6fd3edff6979b79f87531400ad694fb7f2c84b1f # v2.2.1
121+
with:
122+
workspaces: rust -> rust/target
123+
124+
- name: Gradle Cache
125+
uses: actions/cache@v3
126+
with:
127+
path: |
128+
~/.gradle/caches
129+
~/.gradle/wrapper
130+
key: ${{ runner.os }}-gradle-${{ hashFiles('**/.gradle*', '**/gradle-wrapper.properties') }}
131+
restore-keys: |
132+
${{ runner.os }}-gradle-
133+
134+
# Build and publish
135+
136+
- name: Assemble release unsigned apk
137+
run: |
138+
./gradlew clean assembleRelease --stacktrace
139+
140+
- name: Sign app APK
141+
uses: r0adkll/sign-android-release@v1
142+
# ID used to access action output
143+
id: sign_app
144+
with:
145+
releaseDirectory: android/build/outputs/apk/release
146+
signingKeyBase64: ${{ secrets.ANDROID_PLAY_STORE_KEYSTORE_BASE64 }}
147+
alias: ${{ secrets.ANDROID_KEYSTORE_KEY_ALIAS }}
148+
keyStorePassword: ${{ secrets.ANDROID_PLAY_STORE_KEYSTORE_PASSWORD }}
149+
keyPassword: ${{ secrets.ANDROID_PLAY_STORE_KEYSTORE_PASSWORD }}
150+
151+
- name: Upload Gplay release APKs
152+
uses: actions/upload-artifact@v3
153+
with:
154+
name: signer-release-signed
155+
path: |
156+
${{steps.sign_app.outputs.signedReleaseFile}}
157+
158+
- name: Publish to Google Play Store
159+
uses: r0adkll/upload-google-play@v1.1.1
160+
with:
161+
serviceAccountJsonPlainText: ${{ secrets.ANDROID_PLAY_STORE_API_JSON }}
162+
releaseFiles: ${{ steps.sign_app.outputs.signedReleaseFile }}
163+
packageName: io.parity.signer
164+
track: internal
165+
166+
167+

README.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -168,6 +168,13 @@ Enable "Show package details" checkmark to select specific version.
168168

169169
**10.** Run the project (`Ctrl+R`). It should build the Rust core library automatically.
170170

171+
# Release Android
172+
173+
- Create PR with new app version updated and tag v* (example "v6.1.3")
174+
- After merging to master - run release-android.yml flow. It will build and sign apk and upload it to internal track in play store
175+
- Create github release with apk from release flow
176+
- Go to play store, promote internal track to production and update changes in play store
177+
171178
# Tests
172179

173180
Core Rust code is fully covered by tests, and they run in CI on each commit. To run tests on your machine:

0 commit comments

Comments
 (0)