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