Skip to content

Commit c5b8927

Browse files
author
josiauh
committed
flutter build workflow
1 parent cff5ba7 commit c5b8927

File tree

1 file changed

+47
-0
lines changed

1 file changed

+47
-0
lines changed

.github/workflows/flutter_build.yml

+47
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
name: Flutter Build
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
pull_request:
8+
branches:
9+
- main
10+
11+
jobs:
12+
build:
13+
runs-on: ${{ matrix.os }}
14+
strategy:
15+
matrix:
16+
os: [ubuntu-latest, macos-latest, windows-latest]
17+
18+
steps:
19+
- name: Checkout repository
20+
uses: actions/checkout@v2
21+
22+
- name: Set up Flutter
23+
uses: subosito/flutter-action@v2
24+
with:
25+
flutter-version: '2.10.0' # Specify the Flutter version you want to use
26+
27+
- name: Install dependencies
28+
run: flutter pub get
29+
30+
- name: Build for ${{ matrix.os }}
31+
run: |
32+
if [ "${{ matrix.os }}" == "ubuntu-latest" ]; then
33+
flutter build linux
34+
elif [ "${{ matrix.os }}" == "macos-latest" ]; then
35+
flutter build macos
36+
elif [ "${{ matrix.os }}" == "windows-latest" ]; then
37+
flutter build windows
38+
fi
39+
40+
- name: Upload build artifacts
41+
uses: actions/upload-artifact@v2
42+
with:
43+
name: build-${{ matrix.os }}
44+
path: |
45+
build/linux/x64/release/bundle/**
46+
build/macos/Build/Products/Release/**
47+
build/windows/runner/Release/**

0 commit comments

Comments
 (0)