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]
|
|
|
|
|
2023-02-19 18:44:53 +02:00
|
|
|
concurrency:
|
|
|
|
group: ${{ github.workflow }}-${{ github.ref }}
|
|
|
|
cancel-in-progress: true
|
|
|
|
|
2023-01-29 01:24:42 +02:00
|
|
|
jobs:
|
|
|
|
build-sign-android:
|
|
|
|
name: Build and sign Android
|
2023-02-23 17:01:47 +02:00
|
|
|
# Skip when PR from a fork
|
2023-09-06 20:01:51 +02:00
|
|
|
if: ${{ !github.event.pull_request.head.repo.fork && github.actor != 'dependabot[bot]' }}
|
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-02-19 18:44:53 +02:00
|
|
|
|
2023-09-06 03:50:22 +02:00
|
|
|
- uses: actions/checkout@v4
|
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-08-19 00:52:40 +02:00
|
|
|
flutter-version: "3.13.0"
|
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
|