1+ name : Android Release
2+
3+ on :
4+ push :
5+ tags :
6+ - ' *'
7+
8+ # Allows you to run this workflow manually from the Actions tab
9+ workflow_dispatch :
10+
11+ jobs :
12+ build :
13+ runs-on : ubuntu-latest
14+
15+ steps :
16+ - name : Keystore Path
17+ run : echo "${{ secrets.ANDROID_KEYSTORE }}"
18+
19+ - name : Checkout repository
20+ uses : actions/checkout@v4
21+
22+ - name : Set up JDK 18
23+ uses : actions/setup-java@v4
24+ with :
25+ distribution : ' zulu'
26+ java-version : 18
27+
28+ - name : Grant execute permission for gradlew
29+ run : chmod +x gradlew
30+
31+ - name : build prod
32+ run : ./gradlew app:assembleRelease
33+
34+ - name : Sign APK
35+ run : |
36+ jarsigner -verbose -sigalg SHA256withRSA -digestalg SHA-256 \
37+ -keystore ${{ secrets.KEYSTORE_PATH }} -storepass ${{ secrets.KEYSTORE_PASSWORD }} \
38+ -keypass ${{ secrets.KEY_PASSWORD }} \
39+ app/build/outputs/apk/release/app-release-unsigned.apk ${{ secrets.KEY_ALIAS }}
40+
41+ - name : Verify signature
42+ run : jarsigner -verify -verbose -certs app/build/outputs/apk/release/app-release-unsigned.apk
43+
44+ - name : Align APK
45+ run : |
46+ $ANDROID_HOME/build-tools/34.0.0/zipalign -v 4 \
47+ app/build/outputs/apk/release/app-release-unsigned.apk \
48+ app/build/outputs/apk/release/app-release.apk
49+
50+
51+ - name : Upload APK Artifact
52+ uses : actions/upload-artifact@v4
53+ with :
54+ name : apk-artifact
55+ path : app-release.apk
56+ compression-level : 5
57+
58+ - name : Checkout Changes
59+ uses : actions/checkout@v4
60+ with :
61+ sparse-checkout : |
62+ CHANGE.md
63+ sparse-checkout-cone-mode : false
64+
65+ - name : Download Build Artifacts
66+ uses : actions/download-artifact@v4
67+ with :
68+ name : apk-artifact
69+
70+ - name : Generate Changelog
71+ run : |
72+ cat CHANGE.md > CHANGE.txt
73+
74+ - name : Release
75+ uses : softprops/action-gh-release@v2
76+ with :
77+ files : |
78+ app-release.apk
79+ body_path : CHANGE.txt
0 commit comments