-
Notifications
You must be signed in to change notification settings - Fork 33
604 lines (590 loc) · 24.3 KB
/
build-multi-os.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
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
# This workflow builds the AYAB release packages
# for Windows, Mac OSX, and Ubuntu/Debian Linux.
#
# The build starts when a version tag is pushed.
# Release assets are also uploaded as workflow
# artifacts, so that they are still available
# for test releases after the release and its
# tag have been deleted.
#
# Script adapted from https://github.com/trappitsch/fbs-release-github-actions
#
# @author Tom Price
# @date July 2020
name: Build
on:
push:
tags:
- "v?[0-9]+.[0-9]+.[0-9]+-?[a-zA-Z0-9]*"
jobs:
setup:
name: Create cache
runs-on: ubuntu-22.04
strategy:
matrix:
python-version: [3.11.9]
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
submodules: recursive
- uses: ./.github/actions/init-environment
id: vars
- name: Get firmware version matching manifest
run: |
echo ${{ steps.vars.outputs.manifest }}
available=$(curl -s https://github.com/AllYarnsAreBeautiful/ayab-firmware/releases | grep -oE '/tag/[^\"]+' | sed -E 's/\/tag\///')
echo $available
match=$(for x in $available; do echo $x; done | grep ^${{ steps.vars.outputs.manifest }} | sort -r | head -1)
echo $match
if [[ $match ]]
then
cd src/main/resources/base/ayab/firmware/
wget https://github.com/AllYarnsAreBeautiful/ayab-firmware/releases/download/$match/ayab_monolithic_uno.hex
else
echo "Error: could not find firmware release matching manifest"
exit 1
fi
- name: Cache firmware
uses: actions/cache/save@v4
with:
path: src/main/resources/base/ayab/firmware/*.hex
key: firmware-${{ steps.vars.outputs.manifest }}
- name: Install dependencies
run: |
sudo apt update
sudo apt-get install -y avrdude libasound2-dev
- name: Install Python modules
run: |
python -m pip install --upgrade pip
python -m pip install --upgrade setuptools
python -m pip install -r requirements.build.txt
- name: Use cached gui files (1)
id: gui1-cache
uses: actions/cache@v4
with:
path: src/main/python/main/ayab/*_gui.py
key: gui1-${{ hashFiles('src/main/python/main/ayab/*_gui.ui') }}
- name: Use cached gui files (2)
id: gui2-cache
uses: actions/cache@v4
with:
path: src/main/python/main/ayab/engine/*_gui.py
key: gui2-${{ hashFiles('src/main/python/main/ayab/engine/*_gui.ui') }}
- name: Use cached logo
id: logo-cache
uses: actions/cache@v4
with:
path: src/main/python/main/ayab/ayab_logo_rc.py
key: logo-${{ hashFiles('src/main/python/main/ayab/ayab_logo_rc.qrc') }}
- name: Use cached graphics
id: e-cache
uses: actions/cache@v4
with:
path: src/main/python/main/ayab/engine/*_rc.py
key: e-${{ hashFiles('src/main/python/main/ayab/engine/*_rc.qrc') }}
- name: Use cached translation files
id: qm-cache
uses: actions/cache@v4
with:
path: src/main/resources/base/ayab/translations/*.qm
key: qm-${{ hashFiles('src/main/resources/base/ayab/translations/ayab-translation-master.tsv') }}
- name: Use cached `base.json` file
id: base-cache
uses: actions/cache@v4
with:
path: src/build/settings/base.json
key: base-${{ steps.vars.outputs.tag }}
- name: Convert UI and translation files
if: ${{ (steps.gui1-cache.outputs.cache-hit != 'true') ||
(steps.gui2-cache.outputs.cache-hit != 'true') ||
(steps.logo-cache.outputs.cache-hit != 'true') ||
(steps.e-cache.outputs.cache-hit != 'true') ||
(steps.qm-cache.outputs.cache-hit != 'true') }}
run: |
# Install qt6 packages to bring in system dependencies only
sudo apt install -y qt6-base-dev qt6-tools-dev-tools
bash setup-environment.ps1
- name: Cache gui files (1)
if: ${{ (steps.gui1-cache.outputs.cache-hit != 'true') }}
uses: actions/cache/save@v4
with:
path: src/main/python/main/ayab/*_gui.py
key: gui1-${{ hashFiles('src/main/python/main/ayab/*_gui.ui') }}
- name: Cache gui files (2)
if: ${{ (steps.gui2-cache.outputs.cache-hit != 'true') }}
uses: actions/cache/save@v4
with:
path: src/main/python/main/ayab/*_gui.py
key: gui2-${{ hashFiles('src/main/python/main/ayab/engine/*_gui.ui') }}
- name: Cache logo
if: ${{ (steps.logo-cache.outputs.cache-hit != 'true') }}
uses: actions/cache/save@v4
with:
path: src/main/python/main/ayab/ayab_logo_rc.py
key: logo-${{ hashFiles('src/main/python/main/ayab/ayab_logo_rc.qrc') }}
- name: Cache graphics
if: ${{ (steps.e-cache.outputs.cache-hit != 'true') }}
uses: actions/cache/save@v4
with:
path: src/main/python/main/ayab/engine/*_rc.py
key: e-${{ hashFiles('src/main/python/main/ayab/engine/*_rc.qrc') }}
- name: Cache translation files
if: ${{ (steps.qm-cache.outputs.cache-hit != 'true') }}
uses: actions/cache/save@v4
with:
path: src/main/resources/base/ayab/translations/*.qm
key: qm-${{ hashFiles('src/main/resources/base/ayab/translations/ayab-translation-master.tsv') }}
- name: Cache `base.json` file
if: ${{ (steps.base-cache.outputs.cache-hit != 'true') }}
uses: actions/cache/save@v4
with:
path: src/build/settings/base.json
key: base-${{ steps.vars.outputs.tag }}
deploy:
name: Create and deploy source code documentation
runs-on: ubuntu-22.04
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
submodules: recursive
- name: Install dependencies for doxygen
run: |
sudo apt-get install doxygen graphviz -y
- name: Create .nojekyll so that filenames with underscores work on Github Pages
run: |
mkdir -p docs/html
touch docs/html/.nojekyll
- name: Deploy to pages
uses: DenverCoder1/doxygen-github-pages-action@v1.3.1
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
branch: gh-pages
folder: docs/html
config_file: Doxyfile
build-windows:
name: Create and upload Windows release
needs: setup
runs-on: windows-latest
strategy:
matrix:
python-version: [3.11.9]
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
submodules: recursive
- uses: ./.github/actions/init-environment
id: vars
- name: Install dependencies
shell: pwsh
run: |
choco install patch
choco install vcredist-all # fixes dependency on msvcr100.dll
python -m pip install --upgrade pip
python -m pip install --upgrade setuptools
python -m pip install -r requirements.build.txt
python -m pip install -r windows-build\windows_build_requirements.txt
- name: Restore cached firmware
id: firmware-cache
uses: actions/cache@v4
with:
path: src/main/resources/base/ayab/firmware/*.hex
key: firmware-${{ steps.vars.outputs.manifest }}
enableCrossOsArchive: true
fail-on-cache-miss: true
- name: Restore cached gui files (1)
id: gui1-cache
uses: actions/cache@v4
with:
path: src/main/python/main/ayab/*_gui.py
key: gui1-${{ hashFiles('src/main/python/main/ayab/*_gui.ui') }}
enableCrossOsArchive: true
fail-on-cache-miss: true
- name: Restore cached gui files (2)
id: gui2-cache
uses: actions/cache@v4
with:
path: src/main/python/main/ayab/engine/*_gui.py
key: gui2-${{ hashFiles('src/main/python/main/ayab/engine/*_gui.ui') }}
enableCrossOsArchive: true
fail-on-cache-miss: true
- name: Restore cached logo
id: logo-cache
uses: actions/cache@v4
with:
path: src/main/python/main/ayab/ayab_logo_rc.py
key: logo-${{ hashFiles('src/main/python/main/ayab/ayab_logo_rc.qrc') }}
enableCrossOsArchive: true
fail-on-cache-miss: true
- name: Restore cached graphics
id: e-cache
uses: actions/cache@v4
with:
path: src/main/python/main/ayab/engine/*_rc.py
key: e-${{ hashFiles('src/main/python/main/ayab/engine/*_rc.qrc') }}
enableCrossOsArchive: true
fail-on-cache-miss: true
- name: Restore cached translation files
id: qm-cache
uses: actions/cache@v4
with:
path: src/main/resources/base/ayab/translations/*.qm
key: qm-${{ hashFiles('src/main/resources/base/ayab/translations/ayab-translation-master.tsv') }}
enableCrossOsArchive: true
fail-on-cache-miss: true
- name: Restore cached `base.json` file
id: base-cache
uses: actions/cache@v4
with:
path: src/build/settings/base.json
key: base-${{ steps.vars.outputs.tag }}
enableCrossOsArchive: true
fail-on-cache-miss: true
- name: Remove unneeded files
shell: bash
run: |
rm src/main/python/main/ayab/*_gui.ui
rm src/main/python/main/ayab/ayab_logo_rc.qrc
- name: Change line endings to CRLF
shell: bash
run: |
for f in $(ls /main/python/main/ayab/*_gui.py)
do
unix2dos $f
done
for f in $(ls /main/python/main/ayab/engine/*_gui.py)
do
unix2dos $f
done
- name: Check cached files
shell: bash
run: |
pwd
ls -l src/main/python/main/ayab/
ls -l src/main/resources/base/ayab/translations/
# The OpenSSL-based backend for QtNetwork requires the OpenSSL dynamic
# libraries but they are not packaged with Qt or PySide. Pyinstaller
# tries to find them for us and make them available, but does not
# always succeed, see https://github.com/pyinstaller/pyinstaller/issues/8857
# What we can do instead is disable the OpenSSL backend by deleting the
# relevant plugin — this way, Pyinstaller won't package OpenSSL DLLs,
# and Qt will silently fall back to the `schannel` backend that uses
# native Windows libraries. Note that deleting the plugin is an approach
# that is actually suggested in the Qt documentation, see
# https://doc.qt.io/qt-6/ssl.html#considerations-while-packaging-your-application
- name: Remove OpenSSL QtNetwork backend
shell: bash
run: |
find "$(python -c 'import PySide6;print(PySide6.__path__[0])')" -iname qopensslbackend.dll -delete
- name: Build app
shell: pwsh
run: python -m fbs freeze
- name: Create installer
shell: pwsh
run: |
python -m fbs installer
Move-Item -Path target\AYABSetup.exe -Destination target\AYAB-${{ steps.vars.outputs.tag }}.exe
- name: Upload asset
uses: ncipollo/release-action@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}
tag: ${{ steps.vars.outputs.tag }}
commit: ${{ steps.vars.outputs.sha }}
body: "" # release message, alternative to body_path
# body_path: release_text.md # uncomment if not used
draft: ${{ steps.vars.outputs.draft }}
prerelease: false
allowUpdates: true
artifacts: target/AYAB-${{ steps.vars.outputs.tag }}.exe
artifactContentType: application/exe
replacesArtifacts: true
- uses: actions/upload-artifact@v4
with:
name: AYAB-${{ steps.vars.outputs.tag }}.exe
path: target/AYAB-${{ steps.vars.outputs.tag }}.exe
build-macos:
name: Create and upload Mac OSX release
needs: setup
runs-on: macos-14
strategy:
matrix:
python-version: [3.11.9]
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
submodules: recursive
- uses: ./.github/actions/init-environment
id: vars
- name: Install dependencies
run: |
brew install avrdude
mkdir tmp-wheel/
python -m pip install delocate==0.11.0
# Find platform values on e.g. https://pypi.org/project/numpy/1.26.4/#files
python -m pip download --only-binary=:all: --platform macosx_10_09_x86_64 "$(grep numpy requirements.build.txt)"
python -m pip download --only-binary=:all: --platform macosx_11_0_arm64 "$(grep numpy requirements.build.txt)"
delocate-fuse numpy*arm* numpy*x86* -w tmp-wheel/
python -m pip download --only-binary=:all: --platform macosx_10_10_x86_64 "$(grep Pillow requirements.build.txt)"
python -m pip download --only-binary=:all: --platform macosx_11_0_arm64 "$(grep Pillow requirements.build.txt)"
delocate-fuse Pillow*arm* Pillow*x86* -w tmp-wheel/
python -m pip download --only-binary=:all: --platform=macosx_10_9_universal2 "$(grep bitarray requirements.build.txt)"
python -m pip install tmp-wheel/*.whl bitarray*.whl
python -m pip install --no-binary charset_normalizer -r requirements.build.txt
- name: Restore cached firmware
id: firmware-cache
uses: actions/cache@v4
with:
path: src/main/resources/base/ayab/firmware/*.hex
key: firmware-${{ steps.vars.outputs.manifest }}
fail-on-cache-miss: true
- name: Restore cached gui files (1)
id: gui1-cache
uses: actions/cache@v4
with:
path: src/main/python/main/ayab/*_gui.py
key: gui1-${{ hashFiles('src/main/python/main/ayab/*_gui.ui') }}
fail-on-cache-miss: true
- name: Restore cached gui files (2)
id: gui2-cache
uses: actions/cache@v4
with:
path: src/main/python/main/ayab/engine/*_gui.py
key: gui2-${{ hashFiles('src/main/python/main/ayab/engine/*_gui.ui') }}
fail-on-cache-miss: true
- name: Restore cached logo
id: logo-cache
uses: actions/cache@v4
with:
path: src/main/python/main/ayab/ayab_logo_rc.py
key: logo-${{ hashFiles('src/main/python/main/ayab/ayab_logo_rc.qrc') }}
fail-on-cache-miss: true
- name: Restore cached graphics
id: e-cache
uses: actions/cache@v4
with:
path: src/main/python/main/ayab/engine/*_rc.py
key: e-${{ hashFiles('src/main/python/main/ayab/engine/*_rc.qrc') }}
fail-on-cache-miss: true
- name: Restore cached translation files
id: qm-cache
uses: actions/cache@v4
with:
path: src/main/resources/base/ayab/translations/*.qm
key: qm-${{ hashFiles('src/main/resources/base/ayab/translations/ayab-translation-master.tsv') }}
fail-on-cache-miss: true
- name: Restore cached `base.json` file
id: base-cache
uses: actions/cache@v4
with:
path: src/build/settings/base.json
key: base-${{ steps.vars.outputs.tag }}
enableCrossOsArchive: true
fail-on-cache-miss: true
- name: Remove unneeded files
run: |
rm src/main/python/main/ayab/*_gui.ui
rm src/main/python/main/ayab/ayab_logo_rc.qrc
- name: Check cached files
run: |
pwd
ls -l src/main/python/main/ayab/
ls -l src/main/resources/base/ayab/translations/
- name: Build app
run: |
python -m fbs freeze
codesign -s - --force --all-architectures --timestamp --deep ./target/AYAB-mac.app
- name: Create installer
run: |
python -m fbs installer
codesign -s - --force --all-architectures --timestamp --deep ./target/AYAB.dmg
mv target/AYAB.dmg target/AYAB-${{ steps.vars.outputs.tag }}.dmg
- name: Upload asset
uses: ncipollo/release-action@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}
tag: ${{ steps.vars.outputs.tag }}
commit: ${{ steps.vars.outputs.sha }}
body: "" # release message, alternative to body_path
# body_path: release_text.md # uncomment if not used
draft: ${{ steps.vars.outputs.draft }}
prerelease: false
allowUpdates: true
artifacts: target/AYAB-${{ steps.vars.outputs.tag }}.dmg
artifactContentType: application/dmg
replacesArtifacts: true
- uses: actions/upload-artifact@v4
with:
name: AYAB-${{ steps.vars.outputs.tag }}.dmg
path: target/AYAB-${{ steps.vars.outputs.tag }}.dmg
# see https://github.com/AppImage/AppImageKit/wiki/Bundling-Python-apps
build-appimage:
name: Create and upload Linux AppImage release
needs: setup
runs-on: ubuntu-22.04
strategy:
matrix:
# Using Python 3.11.11 specifically for Linux builds due to python-appimage availability
python-version: [3.11.11]
steps:
- name: Checkout repo into AppDir
uses: actions/checkout@v4
with:
submodules: recursive
fetch-depth: 0
- uses: ./.github/actions/init-environment
id: vars
- name: Relocate
run: |
mkdir git
shopt -s extglob dotglob
cp -r !(git) git
shopt -u dotglob
- name: Download AppImage of Python designed for manylinux
run: wget -c https://github.com/niess/python-appimage/releases/download/python${{steps.vars.outputs.python-minor}}/${{steps.vars.outputs.python-appimage}}
- name: Extract the AppImage
run: |
chmod +x ${{steps.vars.outputs.python-appimage}}
./${{steps.vars.outputs.python-appimage}} --appimage-extract
- name: Move repo
run: mv git/* squashfs-root
- name: Install dependencies
run: |
cd squashfs-root
sudo apt-get install -y avrdude libasound2-dev
./AppRun -m pip install --upgrade pip
./AppRun -m pip install --upgrade setuptools
# hack to fix setup.py script with faulty include
./AppRun -m pip install --global-option=build_ext --global-option="-I$(pwd)/opt/${{steps.vars.outputs.python-minor}}/include/${{steps.vars.outputs.python-minor}}" simpleaudio
./AppRun -m pip install -r requirements.build.txt
- name: Add AppDir subdirectories to PATH
run: |
echo "usr/bin" >> $GITHUB_PATH
echo "opt/${{steps.vars.outputs.python-minor}}/bin" >> $GITHUB_PATH
- name: Restore cached firmware
id: firmware-cache
uses: actions/cache@v4
with:
path: src/main/resources/base/ayab/firmware/*.hex
key: firmware-${{ steps.vars.outputs.manifest }}
fail-on-cache-miss: true
- name: Restore cached gui files (1)
id: gui1-cache
uses: actions/cache@v4
with:
path: src/main/python/main/ayab/*_gui.py
key: gui1-${{ hashFiles('src/main/python/main/ayab/*_gui.ui') }}
fail-on-cache-miss: true
- name: Restore cached gui files (2)
id: gui2-cache
uses: actions/cache@v4
with:
path: src/main/python/main/ayab/engine/*_gui.py
key: gui2-${{ hashFiles('src/main/python/main/ayab/engine/*_gui.ui') }}
fail-on-cache-miss: true
- name: Restore cached logo
id: logo-cache
uses: actions/cache@v4
with:
path: src/main/python/main/ayab/ayab_logo_rc.py
key: logo-${{ hashFiles('src/main/python/main/ayab/ayab_logo_rc.qrc') }}
fail-on-cache-miss: true
- name: Restore cached graphics
id: e-cache
uses: actions/cache@v4
with:
path: src/main/python/main/ayab/engine/*_rc.py
key: e-${{ hashFiles('src/main/python/main/ayab/engine/*_rc.qrc') }}
fail-on-cache-miss: true
- name: Restore cached translation files
id: qm-cache
uses: actions/cache@v4
with:
path: src/main/resources/base/ayab/translations/*.qm
key: qm-${{ hashFiles('src/main/resources/base/ayab/translations/ayab-translation-master.tsv') }}
fail-on-cache-miss: true
- name: Restore cached `base.json` file
id: base-cache
uses: actions/cache@v4
with:
path: src/build/settings/base.json
key: base-${{ steps.vars.outputs.tag }}
enableCrossOsArchive: true
fail-on-cache-miss: true
- name: Move cached files
run: |
mv src/main/resources/base/ayab/firmware/*.hex squashfs-root/src/main/resources/base/ayab/firmware/
mv src/main/python/main/ayab/*_gui.py squashfs-root/src/main/python/main/ayab/
mv src/main/python/main/ayab/engine/*_gui.py squashfs-root/src/main/python/main/ayab/engine/
mv src/main/python/main/ayab/ayab_logo_rc.py squashfs-root/src/main/python/main/ayab/
mv src/main/python/main/ayab/engine/lowercase_e_rc.py squashfs-root/src/main/python/main/ayab/engine
mv src/main/python/main/ayab/engine/lowercase_e_reversed_rc.py squashfs-root/src/main/python/main/ayab/engine
mv src/main/resources/base/ayab/translations/*.qm squashfs-root/src/main/resources/base/ayab/translations/
mv src/build/settings/base.json squashfs-root/src/build/settings/base.json
- name: Remove unneeded files
run: |
rm squashfs-root/src/main/python/main/ayab/*_gui.ui
rm squashfs-root/src/main/python/main/ayab/ayab_logo_rc.qrc
rm squashfs-root/src/main/python/main/ayab/engine/lowercase_e_rc.qrc
rm squashfs-root/src/main/python/main/ayab/engine/lowercase_e_reversed_rc.qrc
- name: Check cached files
run: |
pwd
ls -l squashfs-root/src/main/python/main/ayab/
ls -l squashfs-root/src/main/resources/base/ayab/translations/
- name: Replace AppRun
run: |
cd squashfs-root
rm AppRun
cp linux-build/appimage/AppRun .
- name: Add icon
run: |
cd squashfs-root
rm -f *.png
rm -rf usr/share/icons/
cp linux-build/appimage/ayab.png ayab.png
mkdir -p usr/share/icons/hicolor/128x128/apps/
cp ayab.png usr/share/icons/hicolor/128x128/apps/
- name: Create desktop file
run: |
cd squashfs-root
rm -f python*.desktop
mkdir -p usr/share/applications/
rm -f usr/share/applications/*.desktop
cp linux-build/appimage/com.ayab_knitting.ayab.desktop com.ayab_knitting.ayab.desktop
cp com.ayab_knitting.ayab.desktop usr/share/applications/com.ayab_knitting.ayab.desktop
- name: Add metadata
run: |
cd squashfs-root
mkdir -p usr/share/metainfo/
rm -f usr/share/metainfo/*.appdata.xml
cp linux-build/appimage/ayab.appdata.xml usr/share/metainfo/
- name: Convert to AppImage
run: |
wget -c https://github.com/$(wget -q https://github.com/probonopd/go-appimage/releases/expanded_assets/continuous -O - | grep appimagetool-.*-x86_64.AppImage | head -n 1 | cut -d '"' -f 2)
chmod +x appimagetool-*-x86_64.AppImage
chmod 755 squashfs-root
sudo apt install appstream
VERSION=${{steps.vars.outputs.tag}} ./appimagetool-*-x86_64.AppImage squashfs-root/
sudo apt remove appstream
mv ayab-${{ steps.vars.outputs.tag }}-x86_64.AppImage AYAB-${{ steps.vars.outputs.tag }}-x86_64.AppImage
- name: Upload asset
uses: ncipollo/release-action@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}
tag: ${{ steps.vars.outputs.tag }}
commit: ${{ steps.vars.outputs.sha }}
body: "" # release message, alternative to body_path
# body_path: release_text.md # uncomment if not used
draft: ${{ steps.vars.outputs.draft }}
prerelease: false
allowUpdates: true
artifacts: AYAB-${{ steps.vars.outputs.tag }}-x86_64.AppImage
artifactContentType: application/AppImage
replacesArtifacts: true
- uses: actions/upload-artifact@v4
with:
name: AYAB-${{ steps.vars.outputs.tag }}-x86_64.AppImage
path: AYAB-${{ steps.vars.outputs.tag }}-x86_64.AppImage