-
Notifications
You must be signed in to change notification settings - Fork 1
80 lines (71 loc) · 2.6 KB
/
example-app.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
name: Build Example App
on: [push, pull_request]
jobs:
build:
if: ${{ !contains(github.event.head_commit.message, 'ci skip') }}
strategy:
fail-fast: false
matrix:
target: [apk, linux, windows, macos]
variant: [debug, release]
include:
- target: apk
os: ubuntu-latest
pre-build-script: ""
debug-artifact-path: build/app/outputs/flutter-apk/app-debug.apk
release-artifact-path: build/app/outputs/flutter-apk/app-release.apk
- target: linux
os: ubuntu-latest
pre-build-script: |
sudo apt-get update -y
sudo apt-get install -y ninja-build libgtk-3-dev
debug-artifact-path: build/linux/x64/debug/bundle
release-artifact-path: build/linux/x64/release/bundle
- target: windows
os: windows-latest
pre-build-script: ""
debug-artifact-path: build/windows/x64/runner/Debug
release-artifact-path: build/windows/x64/runner/Release
- target: macos
os: macos-latest
pre-build-script: ""
debug-artifact-path: build/macos/Build/Products/Debug/*.app
release-artifact-path: build/macos/Build/Products/Release/*.app
# - target: ios
# os: macos-latest
# pre-build-script: ""
# artifact-path: |
# build/ios/iphoneos/Runner.app
runs-on: ${{ matrix.os }}
name: ${{ matrix.target }}-${{ matrix.variant }}
steps:
# setup environment
- uses: actions/checkout@v4
- uses: actions/setup-java@v4
if: ${{ matrix.target == 'apk' }}
with:
distribution: 'temurin'
java-version: '17'
- uses: subosito/flutter-action@v2
with:
channel: 'stable'
cache: true
- name: pre-build-script script for ${{ matrix.target }}
run: ${{ matrix.pre-build-script }}
# basic format & linting check
- run: dart pub get
- run: dart format --output=none --set-exit-if-changed lib/
- run: dart analyze
# build flutter app
- run: flutter pub get
working-directory: example/
- name: Run flutter ${{ matrix.variant }} build on ${{ matrix.target }}
run: flutter build ${{ matrix.target }} --${{ matrix.variant }} --verbose
working-directory: example/
# upload build artifacts
- uses: actions/upload-artifact@v4
with:
name: example-${{ matrix.target }}-${{ matrix.variant }}
path: |
example/${{ matrix.debug-artifact-path }}
example/${{ matrix.release-artifact-path }}