-
Notifications
You must be signed in to change notification settings - Fork 0
142 lines (119 loc) · 4.51 KB
/
05-flutter-build-devel.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
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
# SPDX-License-Identifier: Unlicense OR 0BSD
# - https://docs.github.com/pt/actions
# - https://github.com/marketplace/actions/flutter-action
name: flutter-build-devel
# Replace 'programma-exemplum-flutter' with your app name
on:
push:
branches:
- main
# Sequence of patterns matched against refs/tags
# tags:
# - 'v*' # Push events to matching v*, i.e. v1.0, v20.15.10
# - v[0-9]+.[0-9]+.[0-9]+
jobs:
# flutter-quick-test #########################################################
# _[por-Latn] Teste rápido: se é para falhar, falhe rápido! [por-Latn]_
flutter-quick-test:
name: flutter-quick-test
runs-on: ubuntu-latest
continue-on-error: false
steps:
#### actions/checkout ____________________________________________________
# _[por-Latn] Clone o repositório para esta máquina de testes [por-Latn]_
- uses: actions/checkout@v2
#### actions/setup-java __________________________________________________
# _[por-Latn] Prepare dependências Java [por-Latn]_
- uses: actions/setup-java@v1
with:
java-version: "12.x"
#### subosito/flutter-action _____________________________________________
# @see https://github.com/marketplace/actions/flutter-action
- uses: subosito/flutter-action@v1
with:
# flutter-version: '1.20.2'
channel: "stable" # or: 'beta', 'dev' or 'master'
- run: dart --version
- run: flutter --version
- run: flutter pub get
# _[por-Latn] Execute testes do Flutter [por-Latn]_
- run: flutter test
flutter-build-unixes:
name: flutter-build-${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
# os: [ubuntu-latest, windows-latest, macos-latest]
os: [ubuntu-latest, macos-latest]
needs: [flutter-quick-test]
steps:
- uses: actions/checkout@v2
- uses: actions/setup-java@v1
with:
java-version: "12.x"
- uses: subosito/flutter-action@v1
with:
# flutter-version: '1.20.2'
# channel: 'beta'
channel: "stable" # or: 'beta', 'dev' or 'master'
- run: dart --version
- run: flutter --version
- run: flutter pub get
- run: flutter test
- run: flutter build web
if: startsWith(matrix.os,'ubuntu')
- run: 'echo "TODO: discover where web folder is, then upload it as zip"'
- run: flutter build apk
if: startsWith(matrix.os,'ubuntu')
- uses: actions/upload-artifact@v2
if: startsWith(matrix.os,'ubuntu')
with:
name: programma-exemplum-flutter.apk
path: build/app/outputs/flutter-apk/app-release.apk
- run: flutter build appbundle
if: startsWith(matrix.os,'ubuntu')
- uses: actions/upload-artifact@v2
if: startsWith(matrix.os,'ubuntu')
with:
name: programma-exemplum-flutter.aab
path: build/app/outputs/bundle/release/app-release.aab
- run: flutter build ios --release --no-codesign
if: startsWith(matrix.os,'macos')
- uses: actions/upload-artifact@v2
if: startsWith(matrix.os,'macos')
with:
name: programma-exemplum-flutter.app
path: build/ios/iphoneos/Runner.app
retention-days: 5 # 5 days retention (this is an huge folder)
flutter-build-windows:
name: Test on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
# os: [ubuntu-latest, windows-latest, macos-latest]
os: [windows-latest]
needs: [flutter-quick-test]
steps:
- uses: actions/checkout@v2
- uses: actions/setup-java@v1
with:
java-version: "12.x"
- uses: subosito/flutter-action@v1
with:
# 2021-10-25: channel: beta required for windows
channel: beta
- run: dart --version
- run: flutter --version
- run: flutter pub get
- run: flutter test
# gambiarra to not re-create the project on beta channel just to test windows
- run: flutter create --platforms=windows --template app --project-name programma_exemplum_flutter --org ai.etica.hxl .
continue-on-error: true
- run: flutter config --enable-windows-desktop
continue-on-error: true
- run: flutter build windows
continue-on-error: true
# TODO:
# - avancado https://github.com/anton-yurchenko/git-release
# - "Unreleased" https://github.com/anton-yurchenko/git-release/issues/47
# - sem changelog: https://github.com/svenstaro/upload-release-action