-
Notifications
You must be signed in to change notification settings - Fork 102
349 lines (280 loc) · 10.8 KB
/
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
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
on:
release:
types: # This configuration does not affect the page_build event above
- created
name: Release Artifacts
jobs:
build-linux:
name: "Build Linux"
runs-on: ubuntu-latest
timeout-minutes: 30
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
steps:
- uses: actions/checkout@v2.4.0
- name: Setup Flutter SDK
uses: subosito/flutter-action@v2.6.1
with:
channel: "stable"
- name: Install Linux build tools
run: sudo apt-get update && sudo apt-get install clang cmake ninja-build pkg-config libgtk-3-dev libblkid-dev liblzma-dev
- name: Enable desktop
run: flutter config --enable-linux-desktop
- name: Install Cider
run: flutter pub global activate cider
- name: Set new Flutter version
run: cider version ${{ github.event.release.tag_name }}
- name: Set Sidekick.desktop version
uses: DamianReeves/write-file-action@v1.0
with:
path: Sidekick.desktop
contents: Version=${{ github.event.release.tag_name }}
write-mode: append
- name: Set Sidekick.desktop version (snap version)
uses: DamianReeves/write-file-action@v1.0
with:
path: snap/gui/sidekick.desktop
contents: Version=${{ github.event.release.tag_name }}
write-mode: append
- name: Set snapcraft.yaml version
uses: DamianReeves/write-file-action@v1.0
with:
path: snap/snapcraft.yaml
contents: 'version: "${{ github.event.release.tag_name }}"'
write-mode: append
- name: Set release changelog
run: cider release
- name: Flutter get packages
run: flutter pub get
- name: Build Runner & version
run: flutter pub run build_runner build --delete-conflicting-outputs
- name: Flutter build app
run: flutter build linux
- name: Compress artifacts
uses: TheDoctor0/zip-release@0.6.1
with:
filename: linux-${{ github.event.release.tag_name }}.zip
- name: Upload files to a GitHub release
uses: svenstaro/upload-release-action@2.2.1
with:
# GitHub token.
repo_token: ${{ secrets.GITHUB_TOKEN }}
# Local file to upload.
file: linux-${{ github.event.release.tag_name }}.zip
# Tag to use as a release.
tag: ${{ github.ref }}
- name: Install appbuilder deps
run: |
sudo add-apt-repository universe
sudo apt install libfuse2 libgtk-3-0
- name: Install appimagebuilder
run: |
wget -O appimage-builder-x86_64.AppImage https://github.com/AppImageCrafters/appimage-builder/releases/download/v1.1.0/appimage-builder-1.1.0-x86_64.AppImage
chmod +x appimage-builder-x86_64.AppImage
sudo mv appimage-builder-x86_64.AppImage /usr/local/bin/appimage-builder
- name: Build AppImage
run: |
appimage-builder --recipe AppImageBuilder.yml
- name: Upload AppImage to release
uses: svenstaro/upload-release-action@2.2.1
with:
# GitHub token.
repo_token: ${{ secrets.GITHUB_TOKEN }}
# Local file to upload.
file: Sidekick-latest-x86_64.AppImage
asset_name: sidekick-linux-${{ github.event.release.tag_name }}.AppImage
# Tag to use as a release.
tag: ${{ github.ref }}
build-macos:
name: "Build MacOS"
runs-on: macos-latest
timeout-minutes: 30
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
steps:
- uses: actions/checkout@v2.4.0
- name: Setup Flutter SDK
uses: subosito/flutter-action@v2.6.1
with:
channel: "stable"
- name: Set Up XCode
uses: BoundfoxStudios/action-xcode-select@v1
- name: Install create-dmg
run: brew install create-dmg
- name: Enable desktop
run: flutter config --enable-macos-desktop
- name: Install Cider
run: flutter pub global activate cider
- name: Set new Flutter version
run: cider version ${{ github.event.release.tag_name }}
- name: Set release changelog
run: cider release
- name: Flutter get packages
run: flutter pub get
- name: Build Runner & version
run: flutter pub run build_runner build --delete-conflicting-outputs
- name: Flutter build app
run: flutter build macos
- name: Create dmg
run: |
./scripts/create_mac_dmg.sh
- name: Compress artifacts
run: zip -r macos-${{ github.event.release.tag_name }}.zip build/macos/Build/Products/Release
- name: Upload artifacts to release
uses: svenstaro/upload-release-action@2.2.1
with:
# GitHub token.
repo_token: ${{ secrets.GITHUB_TOKEN }}
# Local file to upload.
file: macos-${{ github.event.release.tag_name }}.zip
# Tag to use as a release.
tag: ${{ github.ref }}
- name: Upload DMG to release
uses: svenstaro/upload-release-action@2.2.1
with:
# GitHub token.
repo_token: ${{ secrets.GITHUB_TOKEN }}
# Local file to upload.
file: build/macos/Build/Products/Release/Sidekick.dmg
asset_name: sidekick-macos-${{ github.event.release.tag_name }}.dmg
# Tag to use as a release.
tag: ${{ github.ref }}
build-windows-msstore:
name: "Build Windows for MS Store"
runs-on: windows-latest
timeout-minutes: 30
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
steps:
- uses: actions/checkout@v2.4.0
- name: Setup Flutter SDK
uses: subosito/flutter-action@v2.6.1
with:
channel: "stable"
- name: Enable desktop
run: flutter config --enable-windows-desktop
- name: Install Cider
run: flutter pub global activate cider
- name: Set new Flutter version
run: cider version ${{ github.event.release.tag_name }}
- name: Set release changelog
run: cider release
- name: Generate MSIX-compatible version
uses: ashley-taylor/regex-property-action@1.2
id: msixver
with:
value: ${{ github.event.release.tag_name }}
regex: (\-\w+)|(\+\w+)
replacement: ""
- name: Write MSIX
uses: DamianReeves/write-file-action@v1.0
with:
path: pubspec.yaml
contents: |
msix_config:
display_name: Flutter Sidekick
publisher_display_name: Eduardo M.
identity_name: SidekickContributors.SidekickFlutter
publisher: Sidekick Contributors
msix_version: ${{steps.msixver.outputs.value }}.0
logo_path: assets\promo-windows\icon.png
architecture: x64
capabilities: "internetClient,removableStorage"
certificate_path: windows\SIDEKICK-CERT.pfx
certificate_password: ${{ secrets.WIN_CERT_PASS }}
store: true
build_windows: false
write-mode: append
- name: Write MS Store true
uses: DamianReeves/write-file-action@v1.0
with:
path: lib/src/modifiers.dart
contents: |
// Generated file. Do not modify
const isMSStore = true;
write-mode: overwrite
- name: Flutter get packages
run: flutter pub get
- name: Build Runner & version
run: flutter pub run build_runner build --delete-conflicting-outputs
- name: Flutter build app
run: flutter build windows
- name: Create MSIX
run: flutter pub run msix:create
- name: Upload MSIX to release
uses: svenstaro/upload-release-action@2.2.1
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: build/windows/Runner/release/sidekick.msix
asset_name: sidekick-windows-${{ github.event.release.tag_name }}-MS-NS.msix
tag: ${{ github.ref }}
# TODO: Upload automatically to MS Store. MSFT is having some issues with their Azure AD so cannot be done yet.
build-windows-standard:
name: "Build Windows standard"
runs-on: windows-latest
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
steps:
- uses: actions/checkout@v2.4.0
- name: Setup Flutter SDK
uses: subosito/flutter-action@v2.6.1
with:
channel: "stable"
- name: Enable desktop
run: flutter config --enable-windows-desktop
- name: Install Cider
run: flutter pub global activate cider
- name: Set new Flutter version
run: cider version ${{ github.event.release.tag_name }}
- name: Set release changelog
run: cider release
- name: Generate MSIX-compatible version
uses: ashley-taylor/regex-property-action@1.2
id: msixver
with:
value: ${{ github.event.release.tag_name }}
regex: (\-\w+)|(\+\w+)
replacement: ""
- name: Write MSIX
uses: DamianReeves/write-file-action@v1.0
with:
path: pubspec.yaml
contents: |
msix_config:
display_name: Sidekick
publisher_display_name: Eduardo M.
identity_name: 44484EduardoM.SidekickFlutter
publisher: CN=1E781C91-227E-4505-B5B8-7E5EFE39D3A6
msix_version: ${{steps.msixver.outputs.value }}.0
logo_path: assets\promo-windows\icon.png
architecture: x64
capabilities: "internetClient,removableStorage"
certificate_path: windows\SIDEKICK-CERT.pfx
certificate_password: ${{ secrets.WIN_CERT_PASS }}
store: false
install_certificate: false
build_windows: false
write-mode: append
- name: Flutter get packages
run: flutter pub get
- name: Build Runner & version
run: flutter pub run build_runner build --delete-conflicting-outputs
- name: Flutter build app
run: flutter build windows
- name: Create MSIX
run: flutter pub run msix:publish
- name: Compress artifacts
run: tar.exe -zcvf windows-${{ github.event.release.tag_name }}.zip build/windows/Runner/release
- name: Upload artifacts to release
uses: svenstaro/upload-release-action@2.2.1
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: windows-${{ github.event.release.tag_name }}.zip
tag: ${{ github.ref }}
- name: Upload MSIX to release
uses: svenstaro/upload-release-action@2.2.1
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: build/windows/Runner/release/sidekick.msix
asset_name: sidekick-windows-${{ github.event.release.tag_name }}.msix
tag: ${{ github.ref }}