Skip to content

Commit 12d0fbf

Browse files
uncache other platforms
1 parent a2f7efc commit 12d0fbf

File tree

1 file changed

+45
-244
lines changed

1 file changed

+45
-244
lines changed

.github/workflows/build-multi-os.yml

Lines changed: 45 additions & 244 deletions
Original file line numberDiff line numberDiff line change
@@ -19,130 +19,6 @@ on:
1919
- "v?[0-9]+.[0-9]+.[0-9]+-?[a-zA-Z0-9]*"
2020

2121
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-
14622
deploy:
14723
name: Create and deploy source code documentation
14824
runs-on: ubuntu-22.04
@@ -168,7 +44,6 @@ jobs:
16844

16945
build-windows:
17046
name: Create and upload Windows release
171-
needs: setup
17247
runs-on: windows-latest
17348
strategy:
17449
matrix:
@@ -189,62 +64,24 @@ jobs:
18964
python -m pip install --upgrade setuptools
19065
python -m pip install -r requirements.build.txt
19166
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
24885
- name: Remove unneeded files
24986
shell: bash
25087
run: |
@@ -347,8 +184,6 @@ jobs:
347184
fi
348185
- name: Convert UI and translation files
349186
run: |
350-
# sudo apt install -y qt6-base-dev qt6-tools-dev-tools qt6-l10n-tools
351-
# PATH=/usr/lib/qt6/bin:$PATH
352187
bash setup-environment.ps1
353188
- name: Remove unneeded files
354189
run: |
@@ -390,7 +225,6 @@ jobs:
390225
# see https://github.com/AppImage/AppImageKit/wiki/Bundling-Python-apps
391226
build-appimage:
392227
name: Create and upload Linux AppImage release
393-
needs: setup
394228
runs-on: ubuntu-22.04
395229
strategy:
396230
matrix:
@@ -403,6 +237,33 @@ jobs:
403237
fetch-depth: 0
404238
- uses: ./.github/actions/init-environment
405239
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+
406267
- name: Relocate
407268
run: |
408269
mkdir git
@@ -430,66 +291,6 @@ jobs:
430291
run: |
431292
echo "usr/bin" >> $GITHUB_PATH
432293
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
493294
- name: Remove unneeded files
494295
run: |
495296
rm squashfs-root/src/main/python/main/ayab/*_gui.ui

0 commit comments

Comments
 (0)