19
19
- " v?[0-9]+.[0-9]+.[0-9]+-?[a-zA-Z0-9]*"
20
20
21
21
jobs :
22
- setup :
23
- name : Create cache
24
- runs-on : ubuntu-22.04
25
- strategy :
26
- matrix :
27
- python-version : [3.11]
28
- steps :
29
- - name : Checkout code
30
- uses : actions/checkout@v3
31
- with :
32
- submodules : recursive
33
- - uses : ./.github/actions/init-environment
34
- id : vars
35
- - name : Get firmware version matching manifest
36
- run : |
37
- echo ${{ steps.vars.outputs.manifest }}
38
- available=$(curl -s https://github.com/AllYarnsAreBeautiful/ayab-firmware/releases | grep -oE '/tag/[^\"]+' | sed -E 's/\/tag\///')
39
- echo $available
40
- match=$(for x in $available; do echo $x; done | grep ^${{ steps.vars.outputs.manifest }} | sort -r | head -1)
41
- echo $match
42
- if [[ $match ]]
43
- then
44
- cd src/main/resources/base/ayab/firmware/
45
- wget https://github.com/AllYarnsAreBeautiful/ayab-firmware/releases/download/$match/ayab_monolithic_uno.hex
46
- else
47
- echo "Error: could not find firmware release matching manifest"
48
- exit 1
49
- fi
50
- - name : Cache firmware
51
- uses : actions/cache/save@v3
52
- with :
53
- path : src/main/resources/base/ayab/firmware/*.hex
54
- key : firmware-${{ steps.vars.outputs.manifest }}
55
- - name : Install dependencies
56
- run : |
57
- sudo apt update
58
- sudo apt-get install -y avrdude libasound2-dev
59
- - name : Install Python modules
60
- run : |
61
- python -m pip install --upgrade pip
62
- python -m pip install --upgrade setuptools
63
- python -m pip install -r requirements.build.txt
64
- - name : Use cached gui files (1)
65
- id : gui1-cache
66
- uses : actions/cache@v3
67
- with :
68
- path : src/main/python/main/ayab/*_gui.py
69
- key : gui1-${{ hashFiles('src/main/python/main/ayab/*_gui.ui') }}
70
- - name : Use cached gui files (2)
71
- id : gui2-cache
72
- uses : actions/cache@v3
73
- with :
74
- path : src/main/python/main/ayab/engine/*_gui.py
75
- key : gui2-${{ hashFiles('src/main/python/main/ayab/engine/*_gui.ui') }}
76
- - name : Use cached logo
77
- id : logo-cache
78
- uses : actions/cache@v3
79
- with :
80
- path : src/main/python/main/ayab/ayab_logo_rc.py
81
- key : logo-${{ hashFiles('src/main/python/main/ayab/ayab_logo_rc.qrc') }}
82
- - name : Use cached graphics
83
- id : e-cache
84
- uses : actions/cache@v3
85
- with :
86
- path : src/main/python/main/ayab/engine/*_rc.py
87
- key : e-${{ hashFiles('src/main/python/main/ayab/engine/*_rc.qrc') }}
88
- - name : Use cached translation files
89
- id : qm-cache
90
- uses : actions/cache@v3
91
- with :
92
- path : src/main/resources/base/ayab/translations/*.qm
93
- key : qm-${{ hashFiles('src/main/resources/base/ayab/translations/ayab-translation-master.tsv') }}
94
- - name : Use cached `base.json` file
95
- id : base-cache
96
- uses : actions/cache@v3
97
- with :
98
- path : src/build/settings/base.json
99
- key : base-${{ steps.vars.outputs.tag }}
100
- - name : Convert UI and translation files
101
- if : ${{ (steps.gui1-cache.outputs.cache-hit != 'true') ||
102
- (steps.gui2-cache.outputs.cache-hit != 'true') ||
103
- (steps.logo-cache.outputs.cache-hit != 'true') ||
104
- (steps.e-cache.outputs.cache-hit != 'true') ||
105
- (steps.qm-cache.outputs.cache-hit != 'true') }}
106
- run : |
107
- sudo apt install -y qt6-base-dev qt6-tools-dev-tools qt6-l10n-tools
108
- PATH=/usr/lib/qt6/bin:$PATH bash setup-environment.ps1
109
- - name : Cache gui files (1)
110
- if : ${{ (steps.gui1-cache.outputs.cache-hit != 'true') }}
111
- uses : actions/cache/save@v3
112
- with :
113
- path : src/main/python/main/ayab/*_gui.py
114
- key : gui1-${{ hashFiles('src/main/python/main/ayab/*_gui.ui') }}
115
- - name : Cache gui files (2)
116
- if : ${{ (steps.gui2-cache.outputs.cache-hit != 'true') }}
117
- uses : actions/cache/save@v3
118
- with :
119
- path : src/main/python/main/ayab/*_gui.py
120
- key : gui2-${{ hashFiles('src/main/python/main/ayab/engine/*_gui.ui') }}
121
- - name : Cache logo
122
- if : ${{ (steps.logo-cache.outputs.cache-hit != 'true') }}
123
- uses : actions/cache/save@v3
124
- with :
125
- path : src/main/python/main/ayab/ayab_logo_rc.py
126
- key : logo-${{ hashFiles('src/main/python/main/ayab/ayab_logo_rc.qrc') }}
127
- - name : Cache graphics
128
- if : ${{ (steps.e-cache.outputs.cache-hit != 'true') }}
129
- uses : actions/cache/save@v3
130
- with :
131
- path : src/main/python/main/ayab/engine/*_rc.py
132
- key : e-${{ hashFiles('src/main/python/main/ayab/engine/*_rc.qrc') }}
133
- - name : Cache translation files
134
- if : ${{ (steps.qm-cache.outputs.cache-hit != 'true') }}
135
- uses : actions/cache/save@v3
136
- with :
137
- path : src/main/resources/base/ayab/translations/*.qm
138
- key : qm-${{ hashFiles('src/main/resources/base/ayab/translations/ayab-translation-master.tsv') }}
139
- - name : Cache `base.json` file
140
- if : ${{ (steps.base-cache.outputs.cache-hit != 'true') }}
141
- uses : actions/cache/save@v3
142
- with :
143
- path : src/build/settings/base.json
144
- key : base-${{ steps.vars.outputs.tag }}
145
-
146
22
deploy :
147
23
name : Create and deploy source code documentation
148
24
runs-on : ubuntu-22.04
168
44
169
45
build-windows :
170
46
name : Create and upload Windows release
171
- needs : setup
172
47
runs-on : windows-latest
173
48
strategy :
174
49
matrix :
@@ -189,62 +64,24 @@ jobs:
189
64
python -m pip install --upgrade setuptools
190
65
python -m pip install -r requirements.build.txt
191
66
python -m pip install -r windows-build\windows_build_requirements.txt
192
- - name : Restore cached firmware
193
- id : firmware-cache
194
- uses : actions/cache@v3
195
- with :
196
- path : src/main/resources/base/ayab/firmware/*.hex
197
- key : firmware-${{ steps.vars.outputs.manifest }}
198
- enableCrossOsArchive : true
199
- fail-on-cache-miss : true
200
- - name : Restore cached gui files (1)
201
- id : gui1-cache
202
- uses : actions/cache@v3
203
- with :
204
- path : src/main/python/main/ayab/*_gui.py
205
- key : gui1-${{ hashFiles('src/main/python/main/ayab/*_gui.ui') }}
206
- enableCrossOsArchive : true
207
- fail-on-cache-miss : true
208
- - name : Restore cached gui files (2)
209
- id : gui2-cache
210
- uses : actions/cache@v3
211
- with :
212
- path : src/main/python/main/ayab/engine/*_gui.py
213
- key : gui2-${{ hashFiles('src/main/python/main/ayab/engine/*_gui.ui') }}
214
- enableCrossOsArchive : true
215
- fail-on-cache-miss : true
216
- - name : Restore cached logo
217
- id : logo-cache
218
- uses : actions/cache@v3
219
- with :
220
- path : src/main/python/main/ayab/ayab_logo_rc.py
221
- key : logo-${{ hashFiles('src/main/python/main/ayab/ayab_logo_rc.qrc') }}
222
- enableCrossOsArchive : true
223
- fail-on-cache-miss : true
224
- - name : Restore cached graphics
225
- id : e-cache
226
- uses : actions/cache@v3
227
- with :
228
- path : src/main/python/main/ayab/engine/*_rc.py
229
- key : e-${{ hashFiles('src/main/python/main/ayab/engine/*_rc.qrc') }}
230
- enableCrossOsArchive : true
231
- fail-on-cache-miss : true
232
- - name : Restore cached translation files
233
- id : qm-cache
234
- uses : actions/cache@v3
235
- with :
236
- path : src/main/resources/base/ayab/translations/*.qm
237
- key : qm-${{ hashFiles('src/main/resources/base/ayab/translations/ayab-translation-master.tsv') }}
238
- enableCrossOsArchive : true
239
- fail-on-cache-miss : true
240
- - name : Restore cached `base.json` file
241
- id : base-cache
242
- uses : actions/cache@v3
243
- with :
244
- path : src/build/settings/base.json
245
- key : base-${{ steps.vars.outputs.tag }}
246
- enableCrossOsArchive : true
247
- fail-on-cache-miss : true
67
+ - name : Get firmware version matching manifest
68
+ run : |
69
+ echo ${{ steps.vars.outputs.manifest }}
70
+ available=$(curl -s https://github.com/AllYarnsAreBeautiful/ayab-firmware/releases | grep -oE '/tag/[^\"]+' | sed -E 's/\/tag\///')
71
+ echo $available
72
+ match=$(for x in $available; do echo $x; done | grep ^${{ steps.vars.outputs.manifest }} | sort -r | head -1)
73
+ echo $match
74
+ if [[ $match ]]
75
+ then
76
+ cd src/main/resources/base/ayab/firmware/
77
+ wget https://github.com/AllYarnsAreBeautiful/ayab-firmware/releases/download/$match/ayab_monolithic_uno.hex
78
+ else
79
+ echo "Error: could not find firmware release matching manifest"
80
+ exit 1
81
+ fi
82
+ - name : Convert UI and translation files
83
+ run : |
84
+ bash setup-environment.ps1
248
85
- name : Remove unneeded files
249
86
shell : bash
250
87
run : |
@@ -347,8 +184,6 @@ jobs:
347
184
fi
348
185
- name : Convert UI and translation files
349
186
run : |
350
- # sudo apt install -y qt6-base-dev qt6-tools-dev-tools qt6-l10n-tools
351
- # PATH=/usr/lib/qt6/bin:$PATH
352
187
bash setup-environment.ps1
353
188
- name : Remove unneeded files
354
189
run : |
@@ -390,7 +225,6 @@ jobs:
390
225
# see https://github.com/AppImage/AppImageKit/wiki/Bundling-Python-apps
391
226
build-appimage :
392
227
name : Create and upload Linux AppImage release
393
- needs : setup
394
228
runs-on : ubuntu-22.04
395
229
strategy :
396
230
matrix :
@@ -403,6 +237,33 @@ jobs:
403
237
fetch-depth : 0
404
238
- uses : ./.github/actions/init-environment
405
239
id : vars
240
+
241
+ - name : Get firmware version matching manifest
242
+ run : |
243
+ echo ${{ steps.vars.outputs.manifest }}
244
+ available=$(curl -s https://github.com/AllYarnsAreBeautiful/ayab-firmware/releases | grep -oE '/tag/[^\"]+' | sed -E 's/\/tag\///')
245
+ echo $available
246
+ match=$(for x in $available; do echo $x; done | grep ^${{ steps.vars.outputs.manifest }} | sort -r | head -1)
247
+ echo $match
248
+ if [[ $match ]]
249
+ then
250
+ cd src/main/resources/base/ayab/firmware/
251
+ wget https://github.com/AllYarnsAreBeautiful/ayab-firmware/releases/download/$match/ayab_monolithic_uno.hex
252
+ else
253
+ echo "Error: could not find firmware release matching manifest"
254
+ exit 1
255
+ fi
256
+
257
+ - name : Install Python modules
258
+ run : |
259
+ python -m pip install --upgrade pip
260
+ python -m pip install --upgrade setuptools
261
+ python -m pip install -r requirements.build.txt
262
+ - name : Convert UI and translation files
263
+ run : |
264
+ cd squashfs-root
265
+ bash setup-environment.ps1
266
+
406
267
- name : Relocate
407
268
run : |
408
269
mkdir git
@@ -430,66 +291,6 @@ jobs:
430
291
run : |
431
292
echo "usr/bin" >> $GITHUB_PATH
432
293
echo "opt/${{steps.vars.outputs.python}}/bin" >> $GITHUB_PATH
433
- - name : Restore cached firmware
434
- id : firmware-cache
435
- uses : actions/cache@v3
436
- with :
437
- path : src/main/resources/base/ayab/firmware/*.hex
438
- key : firmware-${{ steps.vars.outputs.manifest }}
439
- fail-on-cache-miss : true
440
- - name : Restore cached gui files (1)
441
- id : gui1-cache
442
- uses : actions/cache@v3
443
- with :
444
- path : src/main/python/main/ayab/*_gui.py
445
- key : gui1-${{ hashFiles('src/main/python/main/ayab/*_gui.ui') }}
446
- fail-on-cache-miss : true
447
- - name : Restore cached gui files (2)
448
- id : gui2-cache
449
- uses : actions/cache@v3
450
- with :
451
- path : src/main/python/main/ayab/engine/*_gui.py
452
- key : gui2-${{ hashFiles('src/main/python/main/ayab/engine/*_gui.ui') }}
453
- fail-on-cache-miss : true
454
- - name : Restore cached logo
455
- id : logo-cache
456
- uses : actions/cache@v3
457
- with :
458
- path : src/main/python/main/ayab/ayab_logo_rc.py
459
- key : logo-${{ hashFiles('src/main/python/main/ayab/ayab_logo_rc.qrc') }}
460
- fail-on-cache-miss : true
461
- - name : Restore cached graphics
462
- id : e-cache
463
- uses : actions/cache@v3
464
- with :
465
- path : src/main/python/main/ayab/engine/*_rc.py
466
- key : e-${{ hashFiles('src/main/python/main/ayab/engine/*_rc.qrc') }}
467
- fail-on-cache-miss : true
468
- - name : Restore cached translation files
469
- id : qm-cache
470
- uses : actions/cache@v3
471
- with :
472
- path : src/main/resources/base/ayab/translations/*.qm
473
- key : qm-${{ hashFiles('src/main/resources/base/ayab/translations/ayab-translation-master.tsv') }}
474
- fail-on-cache-miss : true
475
- - name : Restore cached `base.json` file
476
- id : base-cache
477
- uses : actions/cache@v3
478
- with :
479
- path : src/build/settings/base.json
480
- key : base-${{ steps.vars.outputs.tag }}
481
- enableCrossOsArchive : true
482
- fail-on-cache-miss : true
483
- - name : Move cached files
484
- run : |
485
- mv src/main/resources/base/ayab/firmware/*.hex squashfs-root/src/main/resources/base/ayab/firmware/
486
- mv src/main/python/main/ayab/*_gui.py squashfs-root/src/main/python/main/ayab/
487
- mv src/main/python/main/ayab/engine/*_gui.py squashfs-root/src/main/python/main/ayab/engine/
488
- mv src/main/python/main/ayab/ayab_logo_rc.py squashfs-root/src/main/python/main/ayab/
489
- mv src/main/python/main/ayab/engine/lowercase_e_rc.py squashfs-root/src/main/python/main/ayab/engine
490
- mv src/main/python/main/ayab/engine/lowercase_e_reversed_rc.py squashfs-root/src/main/python/main/ayab/engine
491
- mv src/main/resources/base/ayab/translations/*.qm squashfs-root/src/main/resources/base/ayab/translations/
492
- mv src/build/settings/base.json squashfs-root/src/build/settings/base.json
493
294
- name : Remove unneeded files
494
295
run : |
495
296
rm squashfs-root/src/main/python/main/ayab/*_gui.ui
0 commit comments