-
-
Notifications
You must be signed in to change notification settings - Fork 11
93 lines (74 loc) · 2.08 KB
/
build-example.yml
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
81
82
83
84
85
86
87
88
89
90
91
92
93
name: Build example
on:
push:
branches: [ master ]
paths-ignore: [ '**.md' ]
pull_request:
branches: [ master ]
paths-ignore: [ '**.md' ]
jobs:
build-stable-beta:
runs-on: ubuntu-latest
strategy:
matrix:
channel: [ 'stable', 'beta' ]
defaults:
run:
working-directory: ./example
steps:
- uses: actions/checkout@v4
- uses: actions/setup-java@v4
with:
distribution: 'zulu'
java-version: '11'
- uses: subosito/flutter-action@v2.12.0
with:
channel: ${{ matrix.channel }}
- name: Print Dart SDK version
run: dart --version
- name: Print Flutter SDK version
run: flutter --version
- name: Install dependencies
run: flutter pub get
- name: Pub upgrade (if beta)
run: flutter pub upgrade
if: ${{ matrix.channel == 'beta' }}
- name: Format code
run: dart format lib --set-exit-if-changed
if: ${{ matrix.channel == 'stable' }}
- name: Analyze
run: flutter analyze lib
if: ${{ matrix.channel == 'stable' }}
- name: Build APK
run: flutter build apk --no-shrink
- name: Upload APK
uses: actions/upload-artifact@v4
if: ${{ matrix.channel == 'stable' }}
with:
name: app
path: example/build/app/outputs/apk/release/app-release.apk
build-old-versions:
runs-on: ubuntu-latest
strategy:
matrix:
version: [ '3.22.0' ]
defaults:
run:
working-directory: ./example
steps:
- uses: actions/checkout@v4
- uses: actions/setup-java@v4
with:
distribution: 'zulu'
java-version: '11'
- uses: subosito/flutter-action@v2.12.0
with:
flutter-version: ${{ matrix.version }}
- name: Print Dart SDK version
run: dart --version
- name: Print Flutter SDK version
run: flutter --version
- name: Install dependencies
run: flutter pub get
- name: Build APK
run: flutter build apk --no-shrink