mirror of https://git.sr.ht/~rabbits/uxn
Reuse old artifacts if no solar build computers are reachable.
Non-Linux builds are run on computers powered by solar panels in one geographical location, so they are not available 100% of the time. When they are not available, the build script will reuse the previous build artifacts for Windows and macOS, as well as create an empty file at https://rabbits.srht.site/uxn/needs-solar-build so that this situation can be detected. When both build computers are available, the needs-solar-build file will not be present in the Sourcehut upload, so that URL will return a 404 status.
This commit is contained in:
parent
92027cf278
commit
cbc61578b7
22
.build.yml
22
.build.yml
|
@ -4,6 +4,7 @@ packages:
|
||||||
- build-essential
|
- build-essential
|
||||||
- libsdl2-dev
|
- libsdl2-dev
|
||||||
- rsync
|
- rsync
|
||||||
|
- wget
|
||||||
- zip
|
- zip
|
||||||
oauth: pages.sr.ht/PAGES:RW
|
oauth: pages.sr.ht/PAGES:RW
|
||||||
environment:
|
environment:
|
||||||
|
@ -45,13 +46,24 @@ tasks:
|
||||||
done
|
done
|
||||||
[ -e ~/.ssh/id_rsa ] || complete-build
|
[ -e ~/.ssh/id_rsa ] || complete-build
|
||||||
- build-windows: |
|
- build-windows: |
|
||||||
ssh win "export PATH=\"\${PATH}:/mingw64/bin\"; set -ex; cd uxn; git fetch; git checkout .; git clean -xfd; git checkout $(cd uxn && git rev-parse HEAD); MSYSTEM=MSYS ./build.sh --no-run"
|
if ssh win true; then
|
||||||
rsync -rp win:uxn/bin/ build/uxn-win64/uxn/
|
ssh win "export PATH=\"\${PATH}:/mingw64/bin\"; set -ex; cd uxn; git fetch; git checkout .; git clean -xfd; git checkout $(cd uxn && git rev-parse HEAD); MSYSTEM=MSYS ./build.sh --no-run"
|
||||||
|
rsync -rp win:uxn/bin/ build/uxn-win64/uxn/
|
||||||
|
else
|
||||||
|
wget -nv -NP out "https://${SITE}/"uxn{,-essentials}-win64.{tar.gz,zip} || true
|
||||||
|
touch out/needs-solar-build
|
||||||
|
fi
|
||||||
- build-macos: |
|
- build-macos: |
|
||||||
ssh mac "export PATH=\"\${PATH}:/usr/local/bin\"; set -ex; cd uxn; git fetch; git checkout .; git clean -xfd; git checkout $(cd uxn && git rev-parse HEAD); ./build.sh --no-run"
|
if ssh mac true; then
|
||||||
rsync -rp mac:uxn/bin/ build/uxn-mac64/uxn/
|
ssh mac "export PATH=\"\${PATH}:/usr/local/bin\"; set -ex; cd uxn; git fetch; git checkout .; git clean -xfd; git checkout $(cd uxn && git rev-parse HEAD); ./build.sh --no-run"
|
||||||
|
rsync -rp mac:uxn/bin/ build/uxn-mac64/uxn/
|
||||||
|
else
|
||||||
|
wget -nv -NP out "https://${SITE}/"uxn{,-essentials}-mac64.{tar.gz,zip} || true
|
||||||
|
touch out/needs-solar-build
|
||||||
|
fi
|
||||||
- archive: |
|
- archive: |
|
||||||
for PROJECT in uxn-lin64 uxn-win64 uxn-mac64 essentials; do
|
for PROJECT in uxn-lin64 uxn-win64 uxn-mac64 essentials; do
|
||||||
|
[ -d "build/${PROJECT}/uxn" ] || continue
|
||||||
tar -czf "out/${PROJECT}.tar.gz" -C "build/${PROJECT}" uxn
|
tar -czf "out/${PROJECT}.tar.gz" -C "build/${PROJECT}" uxn
|
||||||
( cd "build/${PROJECT}" && zip -qr "../../out/${PROJECT}.zip" uxn )
|
( cd "build/${PROJECT}" && zip -qr "../../out/${PROJECT}.zip" uxn )
|
||||||
if [ "${PROJECT}" != essentials ]; then
|
if [ "${PROJECT}" != essentials ]; then
|
||||||
|
@ -61,8 +73,8 @@ tasks:
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
- upload: |
|
- upload: |
|
||||||
if [ "$(cd uxn && git rev-parse HEAD)" != "$(cd uxn && git rev-parse origin/main)" ]; then exit; fi
|
|
||||||
ls -l out
|
ls -l out
|
||||||
|
if [ "$(cd uxn && git rev-parse HEAD)" != "$(cd uxn && git rev-parse origin/main)" ]; then exit; fi
|
||||||
tar -czf out.tar.gz -C out .
|
tar -czf out.tar.gz -C out .
|
||||||
acurl() {
|
acurl() {
|
||||||
set +x
|
set +x
|
||||||
|
|
Loading…
Reference in New Issue