Skip to content

Commit

Permalink
Sign apk builds (#548)
Browse files Browse the repository at this point in the history
  • Loading branch information
fremartini authored Nov 16, 2023
1 parent bb15ba8 commit db0df6d
Show file tree
Hide file tree
Showing 3 changed files with 50 additions and 21 deletions.
55 changes: 45 additions & 10 deletions .github/actions/build_android/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -38,27 +50,50 @@ 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/[email protected]
with:
name: android
path: android.apk
retention-days: 1
if-no-files-found: error

- name: Build appbundle (prod)
if: ${{ inputs.build_type == 'prod' }}
run: |
flutter build appbundle --flavor production --release --build-name ${{ inputs.version }} --build-number ${{ inputs.build_version }} --target lib/main_production.dart
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/[email protected]
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/[email protected]
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/[email protected]
with:
name: android
path: android.apk
retention-days: 1
if-no-files-found: error
4 changes: 4 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
12 changes: 1 addition & 11 deletions .github/workflows/release-prod.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,21 +45,11 @@ jobs:
with:
name: android

- name: Sign Android appbundle
uses: r0adkll/[email protected]
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/[email protected]
with:
serviceAccountJsonPlainText: ${{ secrets.PLAYSTORE_SERVICE_ACCOUNT_JSON }}
packageName: dk.analog.digitalclipcard
releaseFiles: ${{ steps.sign_app.outputs.signedReleaseFile }}
releaseFiles: android.aab
track: internal
status: draft

0 comments on commit db0df6d

Please sign in to comment.