2023-01-28 23:24:42 +00:00
|
|
|
name: Build Mobile
|
|
|
|
|
|
|
|
on:
|
|
|
|
workflow_dispatch:
|
2023-01-31 15:59:37 +00:00
|
|
|
workflow_call:
|
2023-02-03 18:39:56 +00:00
|
|
|
inputs:
|
|
|
|
ref:
|
|
|
|
required: false
|
|
|
|
type: string
|
2023-01-28 23:24:42 +00:00
|
|
|
pull_request:
|
|
|
|
push:
|
|
|
|
branches: [main]
|
|
|
|
|
2023-02-19 16:44:53 +00:00
|
|
|
concurrency:
|
|
|
|
group: ${{ github.workflow }}-${{ github.ref }}
|
|
|
|
cancel-in-progress: true
|
|
|
|
|
2023-01-28 23:24:42 +00:00
|
|
|
jobs:
|
|
|
|
build-sign-android:
|
|
|
|
name: Build and sign Android
|
2023-02-23 15:01:47 +00:00
|
|
|
# Skip when PR from a fork
|
2023-09-06 18:01:51 +00:00
|
|
|
if: ${{ !github.event.pull_request.head.repo.fork && github.actor != 'dependabot[bot]' }}
|
2023-11-21 23:06:28 +00:00
|
|
|
runs-on: macos-13
|
2023-02-02 03:50:07 +00:00
|
|
|
|
2023-01-28 23:24:42 +00:00
|
|
|
steps:
|
2023-02-03 18:39:56 +00: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-02-19 16:44:53 +00:00
|
|
|
|
2023-09-06 01:50:22 +00:00
|
|
|
- uses: actions/checkout@v4
|
2023-02-03 18:39:56 +00:00
|
|
|
with:
|
|
|
|
ref: ${{ steps.get-ref.outputs.ref }}
|
2023-01-28 23:24:42 +00:00
|
|
|
|
2023-11-30 14:03:24 +00:00
|
|
|
- uses: actions/setup-java@v4
|
2023-01-28 23:24:42 +00:00
|
|
|
with:
|
2023-02-02 03:50:07 +00:00
|
|
|
distribution: "zulu"
|
2023-01-28 23:24:42 +00:00
|
|
|
java-version: "12.x"
|
2023-02-02 03:50:07 +00:00
|
|
|
cache: "gradle"
|
2023-01-28 23:24:42 +00:00
|
|
|
|
|
|
|
- name: Setup Flutter SDK
|
|
|
|
uses: subosito/flutter-action@v2
|
|
|
|
with:
|
2023-02-02 03:50:07 +00:00
|
|
|
channel: "stable"
|
2023-10-11 01:12:01 +00:00
|
|
|
flutter-version: "3.13.6"
|
2023-01-28 23:24:42 +00:00
|
|
|
cache: true
|
|
|
|
|
|
|
|
- name: Create the Keystore
|
|
|
|
env:
|
2023-02-02 03:50:07 +00:00
|
|
|
KEY_JKS: ${{ secrets.KEY_JKS }}
|
|
|
|
working-directory: ./mobile
|
|
|
|
run: echo $KEY_JKS | base64 -d > android/key.jks
|
2023-01-28 23:24:42 +00:00
|
|
|
|
2023-02-02 03:50:07 +00:00
|
|
|
- name: Get Packages
|
2023-01-28 23:24:42 +00:00
|
|
|
working-directory: ./mobile
|
|
|
|
run: flutter pub get
|
|
|
|
|
|
|
|
- name: Build Android App Bundle
|
|
|
|
working-directory: ./mobile
|
2023-02-02 03:50:07 +00:00
|
|
|
env:
|
|
|
|
ALIAS: ${{ secrets.ALIAS }}
|
|
|
|
ANDROID_KEY_PASSWORD: ${{ secrets.ANDROID_KEY_PASSWORD }}
|
|
|
|
ANDROID_STORE_PASSWORD: ${{ secrets.ANDROID_STORE_PASSWORD }}
|
2023-09-07 02:49:53 +00:00
|
|
|
run: |
|
|
|
|
flutter build apk --release
|
|
|
|
flutter build apk --release --split-per-abi --target-platform android-arm,android-arm64,android-x64
|
2023-01-28 23:24:42 +00:00
|
|
|
|
|
|
|
- name: Publish Android Artifact
|
2023-01-30 16:15:18 +00:00
|
|
|
uses: actions/upload-artifact@v3
|
2023-01-28 23:24:42 +00:00
|
|
|
with:
|
|
|
|
name: release-apk-signed
|
2023-09-07 02:49:53 +00:00
|
|
|
path: mobile/build/app/outputs/flutter-apk/*.apk
|