Skip to content

Commit c44da22

Browse files
committed
ci: signed build and release workflows
1 parent 357acdb commit c44da22

2 files changed

Lines changed: 83 additions & 1 deletion

File tree

Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
name: Create Release
2+
on:
3+
push:
4+
branches: master
5+
tags:
6+
- v*
7+
8+
jobs:
9+
release_build:
10+
runs-on: ubuntu-latest
11+
if: startsWith(github.ref, 'refs/tags/')
12+
steps:
13+
- name: Checkout
14+
uses: actions/checkout@v4.1.1
15+
16+
- name: Setup JDK
17+
uses: actions/setup-java@v3.13.0
18+
with:
19+
java-version: '11'
20+
distribution: 'temurin'
21+
cache: gradle
22+
23+
- name: Create local gradle properties files
24+
run: touch local.properties
25+
26+
- name: Add Google Maps API Key
27+
run: echo "MAPS_API_KEY=${{secrets.MAPS_API_KEY}}" >> local.properties
28+
29+
# Here we need to decode keystore.jks from base64 string and place it
30+
# in the folder specified in the release signing configuration
31+
- name: Decode Keystore
32+
id: decode_keystore
33+
uses: timheuer/base64-to-file@v1.2.3
34+
with:
35+
fileName: 'android_keystore.jks'
36+
fileDir: '/home/runner/work/<<project name>>/<<project name>>/app/keystore/'
37+
encodedString: ${{ secrets.SIGNING_KEYSTORE }}
38+
39+
- name: Build Release APK
40+
env:
41+
SIGNING_KEY_ALIAS: ${{ secrets.SIGNING_KEY_ALIAS }}
42+
SIGNING_KEY_PASSWORD: ${{ secrets.SIGNING_KEY_PASSWORD }}
43+
SIGNING_STORE_PASSWORD: ${{ secrets.SIGNING_STORE_PASSWORD }}
44+
run: ./gradlew build -x lint -x lintVitalRelease
45+
46+
- name: Build Release Bundle
47+
run: ./gradlew bundleRelease
48+
env:
49+
SIGNING_KEY_ALIAS: ${{ secrets.SIGNING_KEY_ALIAS }}
50+
SIGNING_KEY_PASSWORD: ${{ secrets.SIGNING_KEY_PASSWORD }}
51+
SIGNING_STORE_PASSWORD: ${{ secrets.SIGNING_STORE_PASSWORD }}
52+
53+
- name: Upload Build to artifacts
54+
uses: actions/upload-artifact@v3.1.3
55+
with:
56+
name: release-artifacts
57+
path: |
58+
app/build/outputs/debug/app-debug.apk
59+
app/build/outputs/bundle/release/
60+
61+
- name: Create Github Release
62+
uses: softprops/action-gh-release@v1
63+
with:
64+
generate_release_notes: true
65+
prerelease: true
66+
files: |
67+
app/build/outputs/apk/debug/app-debug.apk
68+
app/build/outputs/bundle/release/app-release.aab
Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,11 +23,25 @@ jobs:
2323
run: touch local.properties
2424
- name: Add Google Maps API Key
2525
run: echo "MAPS_API_KEY=${{secrets.MAPS_API_KEY}}" >> local.properties
26+
# Here we need to decode keystore.jks from base64 string and place it
27+
# in the folder specified in the release signing configuration
28+
- name: Decode Keystore
29+
id: decode_keystore
30+
uses: timheuer/base64-to-file@v1.2.3
31+
with:
32+
fileName: 'android_keystore.jks'
33+
fileDir: '/home/runner/work/<<project name>>/<<project name>>/app/keystore/'
34+
encodedString: ${{ secrets.SIGNING_KEYSTORE }}
2635
- name: Build debug APK
2736
run: ./gradlew build -x lint -x lintVitalRelease
37+
env:
38+
SIGNING_KEY_ALIAS: ${{ secrets.SIGNING_KEY_ALIAS }}
39+
SIGNING_KEY_PASSWORD: ${{ secrets.SIGNING_KEY_PASSWORD }}
40+
SIGNING_STORE_PASSWORD: ${{ secrets.SIGNING_STORE_PASSWORD }}
41+
2842
- name: Upload APK
2943
uses: actions/upload-artifact@v3.1.3
3044
with:
31-
name: app
45+
name: app-debug-build
3246
path: app/build/outputs/apk/debug/app-debug.apk
3347

0 commit comments

Comments
 (0)