-
Notifications
You must be signed in to change notification settings - Fork 0
406 lines (329 loc) · 12.2 KB
/
tag.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
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
name: Tag build
on:
push:
tags:
- '**'
jobs:
build-android-apk:
name: "Build Android APK"
runs-on: ubuntu-22.04
permissions: write-all
timeout-minutes: 30
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
steps:
- uses: actions/checkout@v4
with:
submodules: 'true'
- name: Install java
uses: actions/setup-java@v3
with:
distribution: "zulu"
java-version: "21.x"
cache: "gradle"
- name: Set up fvm
run: ./scripts/setup_fvm.sh
- name: Enable android
run: fvm flutter config --enable-android
- name: Decode keystore and create jks and properties file for signing the app
shell: bash
run: |
echo "$KEYSTORE" | base64 --decode > app/keystore.jks
echo "storeFile=keystore.jks" >> key.properties
echo "keyAlias=upload" >> key.properties
echo "storePassword=$KEYSTORE_PASSWORD" >> key.properties
echo "keyPassword=$KEYSTORE_PASSWORD" >> key.properties
env:
KEYSTORE: "${{ secrets.ANDROID_RELEASE_KEY }}"
KEYSTORE_PASSWORD: "${{ secrets.ANDROID_RELEASE_KEY_PASSWORD }}"
working-directory: ./android
- name: Build
run: fvm flutter build apk --release
- name: Upload artifcats
uses: actions/upload-artifact@v4
with:
name: android-binary
path: build/app/outputs/flutter-apk/app-release.apk
build-linux:
name: "Build Linux x64"
runs-on: ubuntu-22.04
permissions: write-all
timeout-minutes: 30
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
steps:
- uses: actions/checkout@v4
with:
submodules: 'true'
- name: Install Flutter dependencies
run: |
sudo apt-get update
sudo apt-get install -qy libgtk-3-dev libx11-dev pkg-config cmake ninja-build libblkid-dev clang unzip libayatana-appindicator3-dev
- name: Set up fvm
run: ./scripts/setup_fvm.sh
- name: Build quickjs-c-bridge
run: pushd quickjs-c-bridge; cmake -S ./linux -B ./build/linux; cmake --build build/linux; popd
- name: Enable desktop
run: fvm flutter config --enable-linux-desktop
- name: Some wired mkdir
run: mkdir -p build/linux/x64/release/bundle/lib
- name: Flutter build app
run: fvm flutter build linux --release
- name: Copy libquickjs
run: cp quickjs-c-bridge/build/linux/libquickjs_c_bridge_plugin.so build/linux/x64/release/bundle/lib/ || exit 0
- name: Compress artifacts
run: tar -a -c -f letscheck-linux-x64.tar.xz -C ./build/linux/x64/release/bundle .
- name: Upload artifcats
uses: actions/upload-artifact@v4
with:
name: linux-x64-binary
path: letscheck-linux-x64.tar.xz
build-linux-arm64:
name: "Build Linux arm64"
runs-on: ubuntu-22.04-arm
permissions: write-all
timeout-minutes: 30
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
steps:
- uses: actions/checkout@v4
with:
submodules: 'true'
- name: Install Flutter dependencies
run: |
sudo apt-get update
sudo apt-get install -qy libgtk-3-dev libx11-dev pkg-config cmake ninja-build libblkid-dev clang unzip libayatana-appindicator3-dev
- name: Set up fvm
run: ./scripts/setup_fvm.sh
- name: Build quickjs-c-bridge
run: pushd quickjs-c-bridge; cmake -S ./linux -B ./build/linux; cmake --build build/linux; popd
- name: Enable desktop
run: fvm flutter config --enable-linux-desktop
- name: Some wired mkdir
run: mkdir -p build/linux/arm64/release/bundle/lib
- name: Flutter build app
run: fvm flutter build linux --release
- name: Copy libquickjs
run: cp quickjs-c-bridge/build/linux/libquickjs_c_bridge_plugin.so build/linux/arm64/release/bundle/lib/ || exit 0
- name: Compress artifacts
run: tar -a -c -f letscheck-linux-arm64.tar.xz -C ./build/linux/arm64/release/bundle .
- name: Upload artifcats
uses: actions/upload-artifact@v4
with:
name: linux-arm64-binary
path: letscheck-linux-arm64.tar.xz
build-linux-flatpak:
needs: [build-linux, build-linux-arm64]
name: "Build Linux flatpak"
runs-on: ubuntu-22.04
container:
image: bilelmoussaoui/flatpak-github-actions:freedesktop-22.08
options: --privileged
permissions: write-all
timeout-minutes: 10
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
steps:
- uses: actions/checkout@v4
with:
submodules: 'true'
- name: Download binary from build-linux
uses: actions/download-artifact@v4
with:
name: linux-x64-binary
- name: Extract x64 binary
run: mkdir -p ./build/linux/x64/release/bundle && tar -x -f letscheck-linux-x64.tar.xz -C ./build/linux/x64/release/bundle
- name: Download binary from build-linux-arm64
uses: actions/download-artifact@v4
with:
name: linux-arm64-binary
- name: Extract arm64 binary
run: mkdir -p ./build/linux/arm64/release/bundle && tar -x -f letscheck-linux-arm64.tar.xz -C ./build/linux/arm64/release/bundle
- name: Build flatpak
uses: jochumdev/flatpak-github-actions/flatpak-builder@builder-update-deps
with:
bundle: letscheck.flatpak
manifest-path: ./io.github.jochumdev.letscheck.yml
upload-artifact: "false"
- name: Upload artifcats
uses: actions/upload-artifact@v4
with:
name: linux-flatpak
path: letscheck.flatpak
build-macos:
name: "Build MacOS"
runs-on: macos-latest
permissions: write-all
timeout-minutes: 30
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
steps:
- uses: actions/checkout@v4
with:
submodules: 'true'
- name: "Select the latest stable Xcode 12"
uses: maxim-lobanov/setup-xcode@v1
with:
xcode-version: latest-stable
- name: Set up fvm
run: ./scripts/setup_fvm.sh
- name: Install create-dmg
run: brew install create-dmg
- name: Enable desktop
run: fvm flutter config --enable-macos-desktop
- name: Flutter build app
run: fvm flutter build macos
- name: Create dmg
run: |
./scripts/create_mac_dmg.sh
- name: Compress artifacts
run: cd build/macos/Build/Products/Release && zip -r ../../../../../letscheck-macos.zip letscheck.app
- name: Upload zip
uses: actions/upload-artifact@v4
with:
name: macos-zip
path: letscheck-macos.zip
- name: Upload dmg
uses: actions/upload-artifact@v4
with:
name: macos-dmg
path: build/macos/Build/Products/Release/letscheck.dmg
build-windows:
name: "Build Windows"
runs-on: windows-latest
permissions: write-all
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
steps:
- uses: actions/checkout@v4
with:
submodules: 'true'
- name: Make yq tool available on Windows runners
run: choco install yq
- name: Set up Flutter
uses: subosito/flutter-action@v2
with:
channel: stable
cache: true
flutter-version-file: pubspec.yaml
- name: Enable desktop
run: flutter config --enable-windows-desktop
# - name: Generate MSIX-compatible version
# uses: ashley-taylor/[email protected]
# id: msixver
# with:
# value: ${{ github.event.release.tag_name }}
# regex: (\-\w+)|(\+\w+)
# replacement: ""
# - name: Write MSIX
# uses: DamianReeves/[email protected]
# with:
# path: pubspec.yaml
# contents: |
# msix_config:
# display_name: Letscheck
# publisher_display_name: René Jochum
# identity_name: io.github.jochumdev.letscheck
# publisher: CN=Letscheck
# msix_version: ${{steps.msixver.outputs.value }}.0
# logo_path: assets\icons\letscheck.png
# architecture: x64
# capabilities: "internetClient,removableStorage"
# store: false
# certificate_path: package\letscheck.pfx
# certificate_password: ${{ secrets.WIN_CERT_PASS }}
# build_windows: false
# install_certificate: false
# write-mode: append
- name: Flutter build app
run: flutter build windows
- name: Compress artifacts
run: cd build/windows/x64/runner/Release && C:/ProgramData/Chocolatey/bin/7z.exe a ../../../../../letscheck-windows-x64.zip .
- name: Upload zip
uses: actions/upload-artifact@v4
with:
name: windows-x64-zip
path: letscheck-windows-x64.zip
# - name: Create MSIX
# run: flutter pub run msix:create
# - name: Upload MSIX to release
# uses: svenstaro/upload-release-action@v2
# with:
# repo_token: ${{ secrets.GITHUB_TOKEN }}
# file: build\windows\x64\runner\Release\letscheck.msix
# asset_name: letscheck-windows-x64-${{ github.event.release.tag_name }}.msix
# tag: ${{ github.ref }}
build-web:
name: "Build Web"
runs-on: ubuntu-22.04
permissions: write-all
timeout-minutes: 30
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
steps:
- uses: actions/checkout@v4
with:
submodules: 'true'
fetch-depth: 0
- name: Set up fvm
run: ./scripts/setup_fvm.sh
- name: Enable web
run: fvm flutter config --enable-web
- name: Flutter build app
run: fvm flutter build web --base-href "/letscheck/pwa/" --release
- name: Compress artifacts
run: cd build/web && zip -r ../../letscheck-web.zip .
- name: Upload zip
uses: actions/upload-artifact@v4
with:
name: web-zip
path: letscheck-web.zip
- name: Deploy
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./build/web
destination_dir: pwa
force_orphan: true
user_name: 'github-ci[bot]'
user_email: 'github-actions[bot]@users.noreply.github.com'
commit_message: 'Publish to gh-pages'
release:
needs: [build-android-apk, build-linux-flatpak, build-macos, build-windows, build-web]
name: "Release and upload artifacts"
runs-on: ubuntu-22.04
permissions: write-all
if: startsWith(github.ref, 'refs/tags/')
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
steps:
- uses: actions/checkout@v4
- name: Download binaries
uses: actions/download-artifact@v4
with:
merge-multiple: true
- name: ls downloads
run: ls -la
- name: Rename files
run: |
mv app-release.apk letscheck-${{ github.ref_name }}-android.apk
mv letscheck-linux-x64.tar.xz letscheck-${{ github.ref_name }}-linux-x64.tar.xz
mv letscheck-linux-arm64.tar.xz letscheck-${{ github.ref_name }}-linux-arm64.tar.xz
mv letscheck.flatpak letscheck-${{ github.ref_name }}-linux.flatpak
mv letscheck.dmg letscheck-${{ github.ref_name }}-macos.dmg
mv letscheck-macos.zip letscheck-${{ github.ref_name }}-macos.zip
mv letscheck-windows-x64.zip letscheck-${{ github.ref_name }}-windows-x64.zip
mv letscheck-web.zip letscheck-${{ github.ref_name }}-web.zip
- name: Release
uses: softprops/action-gh-release@v2
if: startsWith(github.ref, 'refs/tags/')
with:
files: |
letscheck-${{ github.ref_name }}-android.apk
letscheck-${{ github.ref_name }}-linux-x64.tar.xz
letscheck-${{ github.ref_name }}-linux-arm64.tar.xz
letscheck-${{ github.ref_name }}-linux.flatpak
letscheck-${{ github.ref_name }}-macos.dmg
letscheck-${{ github.ref_name }}-macos.zip
letscheck-${{ github.ref_name }}-windows-x64.zip
letscheck-${{ github.ref_name }}-web.zip