Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create workflow for build and release #326

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
66 changes: 66 additions & 0 deletions .github/workflows/build_release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
name: "Build & Release Flutter App"

on:
push:
branches:
- master

jobs:
build:
name: Build & Release
runs-on: ubuntu-latest

steps:
#1 Checkout repository
- name: Checkout Repository
uses: actions/checkout@v3

#2 setup java
- name: Set Up Java
uses: actions/setup-java@v3.12.0
with:
distribution: 'oracle'
java-version: '17'

#3 setup Flutter
- name: Set Up Flutter
uses: subosito/flutter-action@v2
with:
flutter-version: '3.19.5'
channel: 'stable'

#4 install dependencies
- name: Install Dependencies
run: flutter pub get

#5 build apk
- name: Build APK
run: flutter build apk --release

#6 build aab
- name: Build appBundle
run: flutter build appbundle

#7 get those build to be available to download
- name: Upload Artifacts
uses: actions/upload-artifact@v2
with:
name: Releases
path: |
build/app/outputs/flutter-apk/app-release.apk
build/app/outputs/bundle/release/app-release.aab
- name: SemanticVersioning
uses: codfish/semantic-release-action@v3
id: semantic
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- run: echo ${{ steps.semantic.outputs.release-version }}

#10 create release with those builds
- name: Create Release
uses: ncipollo/release-action@v1
with:
artifacts: "build/app/outputs/flutter-apk/app-release.apk,build/app/outputs/bundle/release/app-release.aab"
tag: v${{ steps.semantic.outputs.release-version }}
token: ${{ secrets.GITHUB_TOKEN }}