add actions for automatically publishing apk on github #4
Workflow file for this run
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: Flutter Release Workflow | |
on: | |
push: | |
tags: | |
- "v*.*.*" | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v3 | |
- name: Set Up Java | |
uses: actions/[email protected] | |
with: | |
distribution: "oracle" | |
java-version: "17" | |
- name: Set up Flutter | |
uses: subosito/flutter-action@v2 | |
with: | |
flutter-version: "3.24.1" | |
channel: "stable" | |
- name: Install dependencies | |
run: flutter pub get | |
# - name: Run tests | |
# run: flutter test | |
- name: Build APK | |
run: flutter build apk --release | |
- name: Upload APK | |
uses: actions/upload-artifact@v2 | |
with: | |
name: release-apk | |
path: build/app/outputs/flutter-apk/app-release.apk | |
release: | |
runs-on: ubuntu-latest | |
needs: build | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v3 | |
- name: Generate Release Notes | |
id: generate_release_notes | |
uses: release-drafter/release-drafter@v5 | |
with: | |
config-name: release-drafter.yml | |
- name: Create GitHub Release | |
uses: ncipollo/release-action@v1 | |
with: | |
artifacts: build/app/outputs/flutter-apk/app-release.apk | |
token: ${{ secrets.GITHUB_TOKEN }} | |
name: Release ${{ github.ref }} | |
tag: ${{ github.ref }} | |
# body: ${{ steps.generate_release_notes.outputs.notes }} |