Release Android #20
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Release Android | |
on: | |
workflow_dispatch: | |
inputs: | |
releaseRef: | |
description: "Git REF for release (e.g., refs/tags/v1.0.0)" | |
required: true | |
permissions: | |
contents: write | |
jobs: | |
build-and-release: | |
name: Build and Release Android | |
runs-on: ubuntu-latest | |
steps: | |
- name: Set env | |
run: | | |
echo "RELEASE_VERSION=${{ github.event.inputs.releaseRef }}" >> $GITHUB_ENV | |
- uses: actions/checkout@v4 | |
with: | |
ref: ${{ github.event.inputs.releaseRef }} | |
- name: Install and set up Java | |
uses: actions/setup-java@v3 | |
with: | |
distribution: "zulu" | |
java-version: "17.x" | |
- name: Setup Flutter environment | |
uses: subosito/flutter-action@v2 | |
with: | |
flutter-version: "3.16.5" | |
cache: true | |
- name: Install dependencies | |
run: flutter pub get | |
- name: Build with Flutter | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
SIGNING_KEY_ALIAS: ${{ secrets.SIGNING_KEY_ALIAS }} | |
SIGNING_KEY_PASSWORD: ${{ secrets.SIGNING_KEY_PASSWORD }} | |
SIGNING_STORE_PASSWORD: ${{ secrets.SIGNING_KEYSTORE_PASSWORD }} | |
run: flutter build apk | |
- name: Sign APK | |
id: sign_apk | |
uses: ilharp/sign-android-release@v1 | |
with: | |
releaseDir: build/app/outputs/flutter-apk | |
signingKey: ${{ secrets.SIGNING_KEYSTORE }} | |
keyStorePassword: ${{ secrets.SIGNING_KEYSTORE_PASSWORD }} | |
keyAlias: ${{ secrets.SIGNING_KEY_ALIAS }} | |
keyPassword: ${{ secrets.SIGNING_KEY_PASSWORD }} | |
- name: Add version to APK | |
run: mv ${{steps.sign_apk.outputs.signedFile}} finease-${{ env.RELEASE_VERSION }}.apk | |
- name: Create release | |
id: create-release | |
uses: softprops/action-gh-release@v1 | |
with: | |
draft: false | |
tag_name: ${{ env.RELEASE_VERSION }} | |
fail_on_unmatched_files: true | |
files: | | |
finease-${{ env.RELEASE_VERSION }}.apk | |
generate_release_notes: true | |
prerelease: false | |
token: ${{ secrets.GITHUB_TOKEN }} |