2023-01-29 01:24:42 +02:00
|
|
|
name: Build Mobile
|
|
|
|
|
|
|
|
on:
|
|
|
|
workflow_dispatch:
|
2023-01-31 17:59:37 +02:00
|
|
|
workflow_call:
|
2023-02-03 20:39:56 +02:00
|
|
|
inputs:
|
|
|
|
ref:
|
|
|
|
required: false
|
|
|
|
type: string
|
2023-01-29 01:24:42 +02:00
|
|
|
pull_request:
|
|
|
|
push:
|
|
|
|
branches: [main]
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
build-sign-android:
|
|
|
|
name: Build and sign Android
|
2023-02-02 05:50:07 +02:00
|
|
|
runs-on: macos-12
|
|
|
|
|
2023-01-29 01:24:42 +02:00
|
|
|
steps:
|
2023-02-03 20:39:56 +02:00
|
|
|
- name: Determine ref
|
|
|
|
id: get-ref
|
|
|
|
run: |
|
|
|
|
input_ref="${{ inputs.ref }}"
|
|
|
|
github_ref="${{ github.sha }}"
|
|
|
|
ref="${input_ref:-$github_ref}"
|
|
|
|
echo "ref=$ref" >> $GITHUB_OUTPUT
|
|
|
|
|
2023-01-30 18:14:58 +02:00
|
|
|
- uses: actions/checkout@v3
|
2023-02-03 20:39:56 +02:00
|
|
|
with:
|
|
|
|
ref: ${{ steps.get-ref.outputs.ref }}
|
2023-01-29 01:24:42 +02:00
|
|
|
|
|
|
|
- uses: actions/setup-java@v3
|
|
|
|
with:
|
2023-02-02 05:50:07 +02:00
|
|
|
distribution: "zulu"
|
2023-01-29 01:24:42 +02:00
|
|
|
java-version: "12.x"
|
2023-02-02 05:50:07 +02:00
|
|
|
cache: "gradle"
|
2023-01-29 01:24:42 +02:00
|
|
|
|
|
|
|
- name: Setup Flutter SDK
|
|
|
|
uses: subosito/flutter-action@v2
|
|
|
|
with:
|
2023-02-02 05:50:07 +02:00
|
|
|
channel: "stable"
|
2023-02-11 22:23:32 +02:00
|
|
|
flutter-version: "3.7.3"
|
2023-01-29 01:24:42 +02:00
|
|
|
cache: true
|
|
|
|
|
|
|
|
- name: Create the Keystore
|
|
|
|
env:
|
2023-02-02 05:50:07 +02:00
|
|
|
KEY_JKS: ${{ secrets.KEY_JKS }}
|
|
|
|
working-directory: ./mobile
|
|
|
|
run: echo $KEY_JKS | base64 -d > android/key.jks
|
2023-01-29 01:24:42 +02:00
|
|
|
|
2023-02-02 05:50:07 +02:00
|
|
|
- name: Get Packages
|
2023-01-29 01:24:42 +02:00
|
|
|
working-directory: ./mobile
|
|
|
|
run: flutter pub get
|
|
|
|
|
|
|
|
- name: Build Android App Bundle
|
|
|
|
working-directory: ./mobile
|
2023-02-02 05:50:07 +02:00
|
|
|
env:
|
|
|
|
ALIAS: ${{ secrets.ALIAS }}
|
|
|
|
ANDROID_KEY_PASSWORD: ${{ secrets.ANDROID_KEY_PASSWORD }}
|
|
|
|
ANDROID_STORE_PASSWORD: ${{ secrets.ANDROID_STORE_PASSWORD }}
|
2023-01-29 01:24:42 +02:00
|
|
|
run: flutter build apk --release
|
|
|
|
|
|
|
|
- name: Publish Android Artifact
|
2023-01-30 18:15:18 +02:00
|
|
|
uses: actions/upload-artifact@v3
|
2023-01-29 01:24:42 +02:00
|
|
|
with:
|
|
|
|
name: release-apk-signed
|
2023-02-02 05:50:07 +02:00
|
|
|
path: mobile/build/app/outputs/flutter-apk/app-release.apk
|