uxn

Varvara Ordinator, written in ANSI C(SDL2)
git clone https://git.eamoncaddigan.net/uxn.git
Log | Files | Refs | README | LICENSE

.build.yml (4551B)


      1 image: debian/oldstable
      2 packages:
      3     - curl
      4     - build-essential
      5     - libsdl2-dev
      6     - rsync
      7     - wget
      8     - zip
      9 oauth: pages.sr.ht/PAGES:RW
     10 environment:
     11     SITE: rabbits.srht.site/uxn
     12     SSH_HOST_KEYS: |
     13         [w1-uxn.build.alderwick.co.uk]:2222 ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIP+IYCB4JrKklFjWSMRkPBTqUjBqUuhlDQy6/X3l8xj5
     14         [m1-uxn.build.alderwick.co.uk]:2223 ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIDvWVqlHh3XQ5ziEbT55K896/mW2BVDdkU6hWgIfU9md
     15         [p1-uxn.build.alderwick.co.uk]:2224 ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIAgduGa60Tx3PsnEaJDyUzmPmpzGYmDeLFtLcVoU5tJs
     16 secrets:
     17     - 138ad607-a4ec-4d74-88a1-8f3be2ba2d03
     18 sources:
     19     - https://git.sr.ht/~rabbits/uxn
     20 tasks:
     21     - prepare: |
     22         rm -f out build
     23         mkdir -p out build/uxn-lin64 build/uxn-win64 build/uxn-mac64 build/essentials/uxn
     24         umask 077
     25         mkdir -p ~/.ssh
     26         printf '%s\n' "${SSH_HOST_KEYS}" > ~/.ssh/known_hosts
     27         printf 'User build\nStrictHostKeyChecking yes\nCheckHostIP no\nHost win\nHostName w1-uxn.build.alderwick.co.uk\nPort 2222\nHost mac\nHostName m1-uxn.build.alderwick.co.uk\nPort 2223\nHost 9front\nHostName p1-uxn.build.alderwick.co.uk\nPort 2224\n' > ~/.ssh/config
     28     - build-linux: |
     29         cd uxn
     30         ./build.sh --no-run
     31         cp bin/asma.rom ../out/
     32         mv bin ../build/uxn-lin64/uxn
     33     - build-essentials: |
     34         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
     35             PROJECT="${F%%/*}"
     36             if [ "${F}" = "${F%:*}" ]; then
     37                 ROMNAME="${F##*/}"
     38                 ROMNAME="${ROMNAME%.tal}.rom"
     39                 [ "${ROMNAME}" != main.rom ] || ROMNAME="${PROJECT}.rom"
     40             else
     41                 ROMNAME="${F##*:}"
     42                 F="${F%:*}"
     43             fi
     44             [ -d "${PROJECT}" ] || git clone "https://git.sr.ht/~rabbits/${PROJECT}"
     45             ( cd "${PROJECT}" && ../build/uxn-lin64/uxn/uxnasm "${F#*/}" "../build/essentials/uxn/${ROMNAME}" || rm -f "../build/essentials/uxn/${ROMNAME}" )
     46         done
     47         [ -e ~/.ssh/id_rsa ] || complete-build
     48     - build-windows: |
     49         if ssh -o ConnectTimeout=10 win true; then
     50             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"
     51             rsync -rp win:uxn/bin/ build/uxn-win64/uxn/
     52         else
     53             wget -nv -NP out "https://${SITE}/"uxn{,-essentials}-win64.{tar.gz,zip} || true
     54             touch out/needs-solar-build
     55         fi
     56     - build-macos: |
     57         if ssh -o ConnectTimeout=10 mac true; then
     58             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"
     59             rsync -rp mac:uxn/bin/ build/uxn-mac64/uxn/
     60         else
     61             wget -nv -NP out "https://${SITE}/"uxn{,-essentials}-mac64.{tar.gz,zip} || true
     62             touch out/needs-solar-build
     63         fi
     64     - archive: |
     65         for PROJECT in uxn-lin64 uxn-win64 uxn-mac64 essentials; do
     66             [ -d "build/${PROJECT}/uxn" ] || continue
     67             tar -czf "out/${PROJECT}.tar.gz" -C "build/${PROJECT}" uxn
     68             ( cd "build/${PROJECT}" && zip -qr "../../out/${PROJECT}.zip" uxn )
     69             if [ "${PROJECT}" != essentials ]; then
     70                 cp build/essentials/uxn/* "build/${PROJECT}/uxn/"
     71                 tar -czf "out/uxn-essentials-${PROJECT#uxn-}.tar.gz" -C "build/${PROJECT}" uxn
     72                 ( cd "build/${PROJECT}" && zip -qr "../../out/uxn-essentials-${PROJECT#uxn-}.zip" uxn )
     73             fi
     74         done
     75     - upload: |
     76         ls -l out
     77         if [ "$(cd uxn && git rev-parse HEAD)" != "$(cd uxn && git rev-parse origin/main)" ]; then exit; fi
     78         tar -czf out.tar.gz -C out .
     79         acurl() {
     80             set +x
     81             curl -H "Authorization: Bearer ${OAUTH2_TOKEN}" "${@}"
     82             set -x
     83         }
     84         acurl -fsS "https://pages.sr.ht/publish/${SITE}" -Fcontent=@out.tar.gz
     85         acurl -fsS "https://pages.sr.ht/publish/${SITE}" -Fcontent=@out.tar.gz -Fprotocol=GEMINI
     86     - build-9front: |
     87         if ssh -o ConnectTimeout=10 9front true; then
     88             ssh 9front "$(cd uxn && git rev-parse HEAD)"
     89         fi