uxn/.build.yml

79 lines
4.0 KiB
YAML
Raw Normal View History

image: debian/oldstable
packages:
- curl
- build-essential
- libsdl2-dev
- rsync
2022-01-15 21:23:05 -05:00
- zip
oauth: pages.sr.ht/PAGES:RW
environment:
SITE: rabbits.srht.site/uxn
SSH_HOST_KEYS: |
[w1.uxn-build.ald.nu]:2222 ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIP+IYCB4JrKklFjWSMRkPBTqUjBqUuhlDQy6/X3l8xj5
[m1.uxn-build.ald.nu]:2223 ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIDvWVqlHh3XQ5ziEbT55K896/mW2BVDdkU6hWgIfU9md
2022-01-10 11:34:01 -05:00
[p1.uxn-build.ald.nu]:2224 ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIAgduGa60Tx3PsnEaJDyUzmPmpzGYmDeLFtLcVoU5tJs
secrets:
- 138ad607-a4ec-4d74-88a1-8f3be2ba2d03
2021-11-10 02:10:42 -05:00
sources:
- https://git.sr.ht/~rabbits/uxn
tasks:
- prepare: |
rm -f out build
mkdir -p out build/linux-amd64 build/windows-64bit build/macos build/rompack/uxn
umask 077
mkdir -p ~/.ssh
printf '%s\n' "${SSH_HOST_KEYS}" > ~/.ssh/known_hosts
2022-01-10 11:34:01 -05: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
- build-linux: |
cd uxn
./build.sh --no-run
mv bin ../build/linux-amd64/uxn
2022-01-15 21:23:05 -05:00
- build-rompack: |
mkdir -p rompack/uxn
for F in uxn/projects/software/calc.tal uxn/projects/software/launcher.tal uxn/projects/examples/demos/piano.tal uxn/projects/examples/demos/clock.tal catclock/src/main.tal dexe/src/main.tal donsol/src/main.tal left/src/main.tal nasu/src/main.tal noodle/src/main.tal orca-toy/src/main.tal:orca.rom turye/src/main.tal; do
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}"
( cd "${PROJECT}" && ../build/linux-amd64/uxn/uxnasm "${F#*/}" "../build/rompack/uxn/${ROMNAME}" || rm -f "../build/rompack/uxn/${ROMNAME}" )
2022-01-15 21:23:05 -05:00
done
2021-11-10 02:10:42 -05:00
[ -e ~/.ssh/id_rsa ] || complete-build
- build-windows: |
ssh win "rm -f uxn-windows-64bit.zip; 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/windows-64bit/uxn/
- build-macos: |
ssh mac "rm -f uxn-macos.tar.gz; 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/macos/uxn/
- archive: |
for PROJECT in linux-amd64 windows-64bit macos rompack; do
tar -czf "out/uxn-${PROJECT}.tar.gz" -C "build/${PROJECT}" uxn
( cd "build/${PROJECT}" && zip -qr "../../out/uxn-${PROJECT}.zip" uxn )
2022-01-23 16:09:27 -05:00
if [ "${PROJECT}" = rompack ]; then
cp "out/uxn-${PROJECT}.tar.gz" out/uxn-essentials.tar.gz
cp "out/uxn-${PROJECT}.zip" out/uxn-essentials.zip
else
2022-01-23 16:19:00 -05:00
cp build/rompack/uxn/* "build/${PROJECT}/uxn/"
2022-01-23 16:09:27 -05:00
tar -czf "out/uxn-essentials-${PROJECT}.tar.gz" -C "build/${PROJECT}" uxn
( cd "build/${PROJECT}" && zip -qr "../../out/uxn-essentials-${PROJECT}.zip" uxn )
fi
done
- upload: |
2021-10-14 19:20:57 -04:00
if [ "$(cd uxn && git rev-parse HEAD)" != "$(cd uxn && git rev-parse origin/main)" ]; then exit; fi
ls -l out
2022-01-15 21:36:39 -05:00
tar -czf out.tar.gz -C out .
acurl() {
set +x
curl -H "Authorization: Bearer ${OAUTH2_TOKEN}" "${@}"
set -x
}
2022-01-15 21:36:39 -05: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 11:34:01 -05:00
- build-9front: |
ssh 9front "$(cd uxn && git rev-parse HEAD)"