dateapp/.github/workflows/android.yml

59 lines
1.7 KiB
YAML

name: "Android Build"
on:
push:
tags: ['v*']
jobs:
build:
runs-on: ubuntu-latest
permissions:
contents: write
timeout-minutes: 25
steps:
- name: "Code Checkout"
uses: actions/checkout@v3
- name: "Java Setup"
uses: actions/setup-java@v2
with:
distribution: 'zulu'
java-version: '11'
- name: "Install Missing Packages"
run: sudo apt-get update -y && sudo apt-get install -y ninja-build libgtk-3-dev
- name: "Flutter Action"
uses: subosito/flutter-action@v2.12.0
with:
flutter-version: '3.16.9'
channel: 'stable'
- name: "Flutter: Doctor"
run: flutter doctor
- name: "Flutter: Get Packages"
run: flutter pub get
- name: Create key.properties
run: |
echo "storeFile=${{ steps.android_keystore.outputs.filePath }}" > android/key.properties
echo "storePassword=${{ secrets.ANDROID_KEYSTORE_PASSWORD }}" >> android/key.properties
echo "keyPassword=${{ secrets.ANDROID_KEY_PASSWORD }}" >> android/key.properties
echo "keyAlias=${{ secrets.ANDROID_KEY_ALIAS }}" >> android/key.properties
- name: "Flutter: Build Android APK"
run: flutter build apk
- name: "Flutter: Build Android AppBundle"
run: flutter build appbundle
- name: Release to GitHub
uses: ncipollo/release-action@v1
with:
artifacts: "build/app/outputs/flutter-apk/app-release.apk,build/app/outputs/bundle/release/app-release.aab"
tag: ${{ steps.version.outputs.content }}
commit: ${{ github.sha }}
allowUpdates: true