Skip to content

Commit cdb071f

Browse files
authored
Enhance Android release workflow with signing steps
Added steps to decode keystore, build, sign, and align APK.
1 parent 0cb9c0c commit cdb071f

File tree

1 file changed

+30
-1
lines changed

1 file changed

+30
-1
lines changed

.github/workflows/android-release.yml

Lines changed: 30 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,36 @@ jobs:
6161
- name: Upload artifacts
6262
uses: actions/upload-artifact@v4
6363
with:
64-
name: ipv64net-${{ steps.rename.outputs.version }}
64+
name: ipv64net-${{ steps.rename.outputs.version }}-debug
6565
path: |
6666
${{ steps.rename.outputs.apk }}
6767
# ${{ steps.rename.outputs.aab }}
68+
69+
- name: Decode keystore
70+
if: ${{ secrets.ANDROID_KEYSTORE_BASE64 != '' }}
71+
run: echo "${{ secrets.ANDROID_KEYSTORE_BASE64 }}" | base64 -d > releaseKey.jks
72+
73+
- name: Build release APK
74+
run: ./gradlew assembleRelease
75+
76+
- name: Sign APK
77+
run: |
78+
jarsigner -verbose -sigalg SHA256withRSA -digestalg SHA-256 \
79+
-keystore releaseKey.jks -storepass ${{ secrets.ANDROID_KEYSTORE_PASSWORD }} \
80+
-keypass ${{ secrets.ANDROID_KEY_PASSWORD }} \
81+
app/build/outputs/apk/release/app-release-unsigned.apk ${{ secrets.ANDROID_KEY_ALIAS }}
82+
83+
- name: Verify signature
84+
run: jarsigner -verify -verbose -certs app/build/outputs/apk/release/app-release-unsigned.apk
85+
86+
- name: Align APK
87+
run: |
88+
$ANDROID_HOME/build-tools/34.0.0/zipalign -v 4 \
89+
app/build/outputs/apk/release/app-release-unsigned.apk \
90+
app/build/outputs/apk/release/app-release.apk
91+
92+
- name: Upload Signed APK
93+
uses: actions/upload-artifact@v3
94+
with:
95+
name: ipv64net-${{ steps.rename.outputs.version }}-signed
96+
path: app/build/outputs/apk/release/app-release.apk

0 commit comments

Comments
 (0)