Skip to content

Commit 9de86f8

Browse files
get firmware_url
1 parent b5c9a97 commit 9de86f8

File tree

2 files changed

+22
-13
lines changed

2 files changed

+22
-13
lines changed

.github/actions/init-environment/action.yml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,25 @@ runs:
2525
echo "manifest=$(cat src/main/resources/base/ayab/firmware/manifest.txt)" >> $GITHUB_OUTPUT
2626
echo "python=python${{matrix.python-version}}" >> $GITHUB_OUTPUT
2727
echo "python-appimage=python${{matrix.python-version}}.9-cp311-cp311-manylinux_2_28_x86_64.AppImage" >> $GITHUB_OUTPUT
28+
29+
- name: Get firmware version matching manifest
30+
shell: bash
31+
run: |
32+
echo ${{ steps.vars.outputs.manifest }}
33+
available=$(curl -s https://github.com/AllYarnsAreBeautiful/ayab-firmware/releases | grep -oE '/tag/[^\"]+' | sed -E 's/\/tag\///')
34+
echo $available
35+
match=$(for x in $available; do echo $x; done | grep ^${{ steps.vars.outputs.manifest }} | sort -r | head -1)
36+
echo $match
37+
if [[ $match ]]
38+
then
39+
cd src/main/resources/base/ayab/firmware/
40+
url=https://github.com/AllYarnsAreBeautiful/ayab-firmware/releases/download/$match/ayab_monolithic_uno.hex
41+
echo "firmware_url=${url}" >> $GITHUB_OUTPUT
42+
else
43+
echo "Error: could not find firmware release matching manifest"
44+
exit 1
45+
fi
46+
2847
- name: Set PACKAGE_VERSION
2948
shell: bash
3049
run: |

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

Lines changed: 3 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -65,20 +65,10 @@ jobs:
6565
python -m pip install -r requirements.build.txt
6666
python -m pip install -r windows-build\windows_build_requirements.txt
6767
- name: Get firmware version matching manifest
68+
shell: bash
6869
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
70+
cd src/main/resources/base/ayab/firmware/
71+
wget {{ steps.vars.outputs.firmware_url }}
8272
- name: Convert UI and translation files
8373
run: |
8474
bash setup-environment.ps1

0 commit comments

Comments
 (0)