-
Notifications
You must be signed in to change notification settings - Fork 0
198 lines (164 loc) · 6.24 KB
/
07-flutter-release.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
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
# SPDX-License-Identifier: Unlicense OR 0BSD
# - https://docs.github.com/pt/actions
# - https://github.com/marketplace/actions/flutter-action
# - https://github.com/anton-yurchenko/git-release
name: flutter-release
on:
push:
tags:
# - 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-on-ubuntu:
name: flutter-build-on-ubuntu
runs-on: ubuntu-latest
continue-on-error: true
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
# _[por-Latn] Execute testes do Flutter (vide flutter-quick-test) [por-Latn]_
# - run: flutter test
- run: flutter build web
- run: 'echo "TODO: discover where web folder is, then upload it as zip"'
- run: flutter build apk
- uses: actions/upload-artifact@v2
with:
name: programma-exemplum-flutter.apk
path: build/app/outputs/flutter-apk/app-release.apk
- run: flutter build appbundle
- uses: actions/upload-artifact@v2
with:
name: programma-exemplum-flutter.aab
path: build/app/outputs/bundle/release/app-release.aab
flutter-build-on-macos:
name: flutter-build-on-macos
runs-on: macos-latest
continue-on-error: true
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:
channel: "stable" # or: 'beta', 'dev' or 'master'
- run: dart --version
- run: flutter --version
- run: flutter pub get
# _[por-Latn] Execute testes do Flutter (vide flutter-quick-test) [por-Latn]_
# - run: flutter test
- 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-on-windows:
name: flutter-build-on-windows
runs-on: 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
# _[por-Latn] Execute testes do Flutter (vide flutter-quick-test) [por-Latn]_
# - 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
flutter-release:
name: flutter-release
runs-on: ubuntu-latest
needs:
- flutter-quick-test
- flutter-build-on-ubuntu
- flutter-build-on-macos
- flutter-build-on-windows
# continue-on-error: true
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
- run: "echo 'TODO https://github.com/anton-yurchenko/git-release/blob/main/docs/example.md'"
# Download all artifacts to the current working directory
- uses: actions/download-artifact@v2
- name: Display structure of downloaded files
run: ls -R
- name: Display structure of downloaded files
run: ls -lha
- name: "GitHub Release: update/publish lastest"
uses: docker://antonyurchenko/git-release:latest
continue-on-error: true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
UNRELEASED: "update"
with:
# programma-exemplum-flutter.app 168mb, too much
# INFO uploading asset: programma-exemplum-flutter.aab
args: |
programma-exemplum-flutter.apk/app-release.apk
- name: "GitHub Release: publish specific release"
uses: docker://antonyurchenko/git-release:latest
continue-on-error: true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
args: |
programma-exemplum-flutter.apk/app-release.apk
# 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