Skip to content

Commit

Permalink
ci: sign apk
Browse files Browse the repository at this point in the history
  • Loading branch information
Mythologyli committed Nov 3, 2023
1 parent d0d7eca commit 133d545
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 5 deletions.
17 changes: 13 additions & 4 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -69,19 +69,28 @@ jobs:
- name: Build APK
run: |
chmod +x gradlew
./gradlew assembleDebug
cp app/build/outputs/apk/debug/app-debug.apk ./ZJUConnectForAndroid.apk
./gradlew assembleRelease
- name: Sign APK
uses: r0adkll/sign-android-release@v1
id: sign_app
with:
releaseDirectory: app/build/outputs/apk/release
signingKeyBase64: ${{ secrets.SIGNING_KEY }}
alias: ${{ secrets.ALIAS }}
keyStorePassword: ${{ secrets.KEY_STORE_PASSWORD }}
keyPassword: ${{ secrets.KEY_PASSWORD }}

- name: Upload artifact
if: github.event_name != 'release'
uses: actions/upload-artifact@v3
with:
name: ZJUConnectForAndroid
path: ZJUConnectForAndroid.apk
path: ${{steps.sign_app.outputs.signedReleaseFile}}

- name: Upload release binary
if: github.event_name == 'release'
env:
GITHUB_TOKEN: ${{ github.token }}
run: |
gh release upload ${{ github.event.release.tag_name }} ZJUConnectForAndroid.apk
gh release upload ${{ github.event.release.tag_name }} ${{steps.sign_app.outputs.signedReleaseFile}}
3 changes: 2 additions & 1 deletion app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@ android {
minSdk 24
targetSdk 34
versionCode 1
versionName "1.0"
versionName "0.1.0"
archivesBaseName = "ZJUConnectForAndroid-v$versionName"

testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
Expand Down

0 comments on commit 133d545

Please sign in to comment.