diff --git a/.github/actions/build_android/action.yml b/.github/actions/build_android/action.yml index 02abec3f5..e1da18853 100644 --- a/.github/actions/build_android/action.yml +++ b/.github/actions/build_android/action.yml @@ -16,6 +16,18 @@ inputs: options: - dev - prod + signingKeyBase64: + required: true + description: "Android signing key b64" + alias: + required: true + description: "Android key alias" + keyStorePassword: + required: true + description: "Android keystore password" + keyPassword: + required: true + description: "Android key password" runs: using: "composite" @@ -38,15 +50,6 @@ runs: mv build/app/outputs/flutter-apk/app-development-release.apk android.apk shell: bash - - name: Upload apk (dev) - if: ${{ !!inputs.store_artifacts && inputs.build_type == 'dev'}} - uses: actions/upload-artifact@v3.1.3 - with: - name: android - path: android.apk - retention-days: 1 - if-no-files-found: error - - name: Build appbundle (prod) if: ${{ inputs.build_type == 'prod' }} run: | @@ -54,11 +57,43 @@ runs: mv build/app/outputs/bundle/productionRelease/app-production-release.aab android.aab shell: bash - - name: Upload appbundle (prod) + - name: Sign artifact + if: ${{ !!inputs.store_artifacts }} + uses: r0adkll/sign-android-release@v1.0.4 + id: sign_app + with: + releaseDirectory: . + signingKeyBase64: ${{ inputs.signingKeyBase64 }} + alias: ${{ inputs.alias }} + keyStorePassword: ${{ inputs.keyStorePassword }} + keyPassword: ${{ inputs.keyPassword }} + + - name: Move appbundle + if: ${{ !!inputs.store_artifacts && inputs.build_type == 'prod'}} + run: | + mv ${{steps.sign_app.outputs.signedReleaseFile}} android.aab + shell: bash + + - name: Upload appbundle if: ${{ !!inputs.store_artifacts && inputs.build_type == 'prod'}} uses: actions/upload-artifact@v3.1.3 with: name: android path: android.aab retention-days: 1 + if-no-files-found: error + + - name: Move apk + if: ${{ !!inputs.store_artifacts && inputs.build_type != 'prod'}} + run: | + mv ${{steps.sign_app.outputs.signedReleaseFile}} android.apk + shell: bash + + - name: Upload apk + if: ${{ !!inputs.store_artifacts && inputs.build_type != 'prod'}} + uses: actions/upload-artifact@v3.1.3 + with: + name: android + path: android.apk + retention-days: 1 if-no-files-found: error \ No newline at end of file diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index a2d9744bb..0b8fce2f8 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -92,3 +92,7 @@ jobs: build_version: ${{ needs.version.outputs.build_version }} store_artifacts: ${{ inputs.store_artifacts }} build_type: ${{ inputs.build_type }} + signingKeyBase64: ${{ secrets.ANDROID_KEYSTORE }} + alias: ${{ secrets.ANDROID_KEY_ALIAS }} + keyStorePassword: ${{ secrets.ANDROID_KEYSTORE_PASSWORD }} + keyPassword: ${{ secrets.ANDROID_KEY_PASSWORD }} diff --git a/.github/workflows/release-prod.yml b/.github/workflows/release-prod.yml index 881ef142b..4a8f24829 100644 --- a/.github/workflows/release-prod.yml +++ b/.github/workflows/release-prod.yml @@ -45,21 +45,11 @@ jobs: with: name: android - - name: Sign Android appbundle - uses: r0adkll/sign-android-release@v1.0.4 - id: sign_app - with: - releaseDirectory: . - signingKeyBase64: ${{ secrets.ANDROID_KEYSTORE }} - alias: ${{ secrets.ANDROID_KEY_ALIAS }} - keyStorePassword: ${{ secrets.ANDROID_KEYSTORE_PASSWORD }} - keyPassword: ${{ secrets.ANDROID_KEY_PASSWORD }} - - name: Upload to Google Play Store uses: r0adkll/upload-google-play@v1.1.2 with: serviceAccountJsonPlainText: ${{ secrets.PLAYSTORE_SERVICE_ACCOUNT_JSON }} packageName: dk.analog.digitalclipcard - releaseFiles: ${{ steps.sign_app.outputs.signedReleaseFile }} + releaseFiles: android.aab track: internal status: draft