diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index ac399d0..485f993 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -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}} diff --git a/app/build.gradle b/app/build.gradle index 34a7f17..a25be0d 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -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" }