Skip to content
name: Flutter Build appBundle
# This workflow is triggered on pushes to the repository.
on:
push:
branches:
- main
# on: push # Default will running for every branch.
jobs:
build:
# This job will run on ubuntu virtual machine
permissions: write-all
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-deap: 0
- name: Get next version
uses: reecetech/[email protected]
id: version
with:
release_branch: main
scheme: semver
increment: patch
- run: echo ${{ steps.version.outputs.version }}
- name: Set up JDK 17.0
uses: actions/setup-java@v1
with:
java-version: 17.0
- name: Setup Android SDK
uses: android-actions/setup-android@v2
- name: Setup Flutter SDK
uses: flutter-actions/setup-flutter@v2
with:
channel: stable
version: 3.19.5
- name: Install dependencies
run: flutter pub get
- name: Analyze project source
run: dart analyze
# - name: Run tests
# run: flutter test
- name: build apk
run: flutter build appbundle
- uses: ilharp/sign-android-release@v1
name: Sign app Bundle
id: sign_app
with:
releaseDir: build/app/outputs/bundle/release
signingKey: ${{ secrets.KEYSTORE }}
keyAlias: ${{ secrets.SIGNING_KEY_ALIAS }}
keyStorePassword: ${{ secrets.SIGNING_STORE_PASSWORD }}
keyPassword: ${{ secrets.SIGNING_KEY_PASSWORD }}
buildToolsVersion: 33.0.0
- name: relase output
uses: actions/upload-artifact@v1
with:
name: release-bundle
path: build/app/outputs/bundle/release/app-release.aab
- name: create-release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITUB_TOKEN }}
with:
tag_name: v${{ steps.version.outputs.version }}
release_name: Release ${{ steps.version.outputs.version }}
draft: true
prerelease: false
- name: Upload release asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ${{steps.sign_app.outputs.signedFile}}
asset_name: reciper-release-${{ steps.version.outputs.version }}.aab
asset_content_type: application/aab
- name: Publish release
uses: eregon/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITUB_TOKEN }}
with:
release_id: ${{ steps.create_release.outputs.id }}