Skip to content

Commit 24a6be6

Browse files
Refactor GitHub Actions workflow for APK release
1 parent 5e3b226 commit 24a6be6

File tree

1 file changed

+51
-11
lines changed

1 file changed

+51
-11
lines changed

.github/workflows/github-actions.yml

Lines changed: 51 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -3,18 +3,58 @@ run-name: Build Release
33
on:
44
- push
55
jobs:
6-
Build:
6+
build_release:
77
runs-on: ubuntu-latest
88
steps:
9-
- uses: ilharp/sign-android-release@v2
10-
name: Sign app APK
11-
id: sign_app
9+
- uses: actions/checkout@v2.6.0
10+
11+
- name: Setup JAVA 11
12+
uses: actions/setup-java@v3
1213
with:
13-
signingKeyBase64: ${{ secrets.SIGNING_KEY }}
14-
alias: ${{ secrets.ALIAS }}
15-
keyStorePassword: ${{ secrets.KEY_STORE_PASSWORD }}
16-
keyPassword: ${{ secrets.KEY_PASSWORD }}
17-
- uses: actions/upload-artifact@v4
14+
distribution: 'corretto'
15+
java-version: 11
16+
17+
- name: Cache Gradle and wrapper
18+
uses: actions/cache@v2
1819
with:
19-
name: Signed app bundle
20-
path: ${{steps.sign_app.outputs.signedFile}}
20+
path: |
21+
~/.gradle/caches
22+
~/.gradle/wrapper
23+
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*') }}
24+
25+
- name: Decode Key
26+
env:
27+
ENCODED_STRING: ${{ secrets.KEYSTORE_KEY_BASE64 }}
28+
SIGNING_KEY_STORE_PATH: ${{ secrets.KEYSTORE_KEY_PATH }}
29+
30+
run: |
31+
echo $ENCODED_STRING > keystore-b64.txt
32+
base64 -d keystore-b64.txt > $SIGNING_KEY_STORE_PATH
33+
34+
- name: Decode Properties
35+
env:
36+
ENCODED_STRING: ${{ secrets.KEYSTORE_PROPERTIES_BASE64 }}
37+
SIGNING_KEY_STORE_PATH: ${{ secrets.KEYSTORE_PROPERTIES_PATH }}
38+
39+
run: |
40+
echo $ENCODED_STRING > keystore-b64.txt
41+
base64 -d keystore-b64.txt > $SIGNING_KEY_STORE_PATH
42+
43+
- name: Build Release apk
44+
run: ./gradlew assembleRelease
45+
46+
- name: Upload Release Build to Artifacts
47+
uses: actions/upload-artifact@v3
48+
with:
49+
name: release-artifacts
50+
paths: |
51+
app/build/outputs/apk/release/
52+
53+
- name: Create Github Release
54+
uses: softprops/action-gh-release@v2
55+
if: github.ref_type == 'tag'
56+
with:
57+
generate_release_notes: true
58+
prerelease: true
59+
files: |
60+
app/build/outputs/apk/release/app-release.apk

0 commit comments

Comments
 (0)