2021-09-23 20:19:02 +00:00
image : debian/oldstable
packages :
- curl
- build-essential
- libsdl2-dev
- rsync
2022-09-20 11:48:27 +00:00
- wget
2022-01-16 02:23:05 +00:00
- zip
2021-09-23 20:19:02 +00:00
oauth : pages.sr.ht/PAGES:RW
environment :
2022-01-17 23:29:35 +00:00
SITE : rabbits.srht.site/uxn
2021-09-23 20:19:02 +00:00
SSH_HOST_KEYS : |
[ w1.uxn-build.ald.nu]:2222 ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIP+IYCB4JrKklFjWSMRkPBTqUjBqUuhlDQy6/X3l8xj5
2021-10-10 20:34:16 +00:00
[ m1.uxn-build.ald.nu]:2223 ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIDvWVqlHh3XQ5ziEbT55K896/mW2BVDdkU6hWgIfU9md
2022-01-10 16:34:01 +00:00
[ p1.uxn-build.ald.nu]:2224 ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIAgduGa60Tx3PsnEaJDyUzmPmpzGYmDeLFtLcVoU5tJs
2021-09-23 20:19:02 +00:00
secrets :
- 138ad607-a4ec-4d74-88a1-8f3be2ba2d03
2021-11-10 07:10:42 +00:00
sources :
- https://git.sr.ht/~rabbits/uxn
2021-09-23 20:19:02 +00:00
tasks :
- prepare : |
2022-01-23 21:01:41 +00:00
rm -f out build
2022-01-23 21:39:43 +00:00
mkdir -p out build/uxn-lin64 build/uxn-win64 build/uxn-mac64 build/essentials/uxn
2021-09-23 20:19:02 +00:00
umask 077
mkdir -p ~/.ssh
printf '%s\n' "${SSH_HOST_KEYS}" > ~/.ssh/known_hosts
2022-01-10 16:34:01 +00:00
printf 'User build\nStrictHostKeyChecking yes\nCheckHostIP no\nHost win\nHostName w1.uxn-build.ald.nu\nPort 2222\nHost mac\nHostName m1.uxn-build.ald.nu\nPort 2223\nHost 9front\nHostName p1.uxn-build.ald.nu\nPort 2224\n' > ~/.ssh/config
2021-09-23 20:19:02 +00:00
- build-linux : |
cd uxn
2021-10-14 22:38:29 +00:00
./build.sh --no-run
2022-03-08 19:04:33 +00:00
cp bin/asma.rom ../out/
2022-01-23 21:39:43 +00:00
mv bin ../build/uxn-lin64/uxn
- build-essentials : |
2022-03-22 21:45:25 +00:00
for F in uxn/projects/software/calc.tal uxn/projects/software/launcher.tal uxn/projects/examples/demos/piano.tal uxn/projects/examples/software/clock.tal catclock/src/catclock.tal dexe/src/dexe.tal donsol/src/main.tal left/src/left.tal nasu/src/nasu.tal noodle/src/noodle.tal orca-toy/src/orca.tal:orca.rom turye/src/turye.tal; do
2022-01-16 02:23:05 +00:00
PROJECT="${F%%/*}"
if [ "${F}" = "${F%:*}" ]; then
ROMNAME="${F##*/}"
ROMNAME="${ROMNAME%.tal}.rom"
[ "${ROMNAME}" != main.rom ] || ROMNAME="${PROJECT}.rom"
else
ROMNAME="${F##*:}"
F="${F%:*}"
fi
[ -d "${PROJECT}" ] || git clone "https://git.sr.ht/~rabbits/${PROJECT}"
2022-01-23 21:39:43 +00:00
( cd "${PROJECT}" && ../build/uxn-lin64/uxn/uxnasm "${F#*/}" "../build/essentials/uxn/${ROMNAME}" || rm -f "../build/essentials/uxn/${ROMNAME}" )
2022-01-16 02:23:05 +00:00
done
2021-11-10 07:10:42 +00:00
[ -e ~/.ssh/id_rsa ] || complete-build
2021-09-23 20:19:02 +00:00
- build-windows : |
2023-01-31 17:12:20 +00:00
if ssh -o ConnectTimeout=10 win true; then
2022-09-20 11:48:27 +00:00
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
2023-01-31 17:12:20 +00:00
touch out/needs-solar-build
2022-09-20 11:48:27 +00:00
fi
2021-10-10 20:34:16 +00:00
- build-macos : |
2022-11-12 11:03:56 +00:00
if ssh -o ConnectTimeout=10 mac true; then
2022-09-20 11:48:27 +00:00
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
2022-01-23 21:01:41 +00:00
- archive : |
2022-01-23 21:39:43 +00:00
for PROJECT in uxn-lin64 uxn-win64 uxn-mac64 essentials; do
2022-09-20 11:48:27 +00:00
[ -d "build/${PROJECT}/uxn" ] || continue
2022-01-23 21:39:43 +00:00
tar -czf "out/${PROJECT}.tar.gz" -C "build/${PROJECT}" uxn
( cd "build/${PROJECT}" && zip -qr "../../out/${PROJECT}.zip" uxn )
if [ "${PROJECT}" != essentials ]; then
cp build/essentials/uxn/* "build/${PROJECT}/uxn/"
tar -czf "out/uxn-essentials-${PROJECT#uxn-}.tar.gz" -C "build/${PROJECT}" uxn
( cd "build/${PROJECT}" && zip -qr "../../out/uxn-essentials-${PROJECT#uxn-}.zip" uxn )
2022-01-23 21:01:41 +00:00
fi
done
2021-09-23 20:19:02 +00:00
- upload : |
ls -l out
2022-09-20 11:48:27 +00:00
if [ "$(cd uxn && git rev-parse HEAD)" != "$(cd uxn && git rev-parse origin/main)" ]; then exit; fi
2022-01-16 02:36:39 +00:00
tar -czf out.tar.gz -C out .
2021-09-23 20:19:02 +00:00
acurl() {
set +x
curl -H "Authorization: Bearer ${OAUTH2_TOKEN}" "${@}"
set -x
}
2022-01-16 02:36:39 +00:00
acurl -fsS "https://pages.sr.ht/publish/${SITE}" -Fcontent=@out.tar.gz
acurl -fsS "https://pages.sr.ht/publish/${SITE}" -Fcontent=@out.tar.gz -Fprotocol=GEMINI
2022-01-10 16:34:01 +00:00
- build-9front : |
2022-11-12 11:03:56 +00:00
if ssh -o ConnectTimeout=10 9front true; then
2022-11-12 10:53:20 +00:00
ssh 9front "$(cd uxn && git rev-parse HEAD)"
fi