Browse code

Added automated builds for Linux and Windows

Andrew Alderwick authored on 23/09/2021 20:19:02
Showing 2 changed files
1 1
new file mode 100644
... ...
@@ -0,0 +1,41 @@
1
+image: debian/oldstable
2
+packages:
3
+    - curl
4
+    - build-essential
5
+    - libsdl2-dev
6
+    - rsync
7
+oauth: pages.sr.ht/PAGES:RW
8
+environment:
9
+    SITE: rabbits.srht.site
10
+    SSH_HOST_KEYS: |
11
+        [w1.uxn-build.ald.nu]:2222 ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIP+IYCB4JrKklFjWSMRkPBTqUjBqUuhlDQy6/X3l8xj5
12
+secrets:
13
+    - 138ad607-a4ec-4d74-88a1-8f3be2ba2d03
14
+tasks:
15
+    - prepare: |
16
+        rm -f out
17
+        mkdir -p out
18
+        umask 077
19
+        mkdir -p ~/.ssh
20
+        printf '%s\n' "${SSH_HOST_KEYS}" > ~/.ssh/known_hosts
21
+        printf 'Host win\nHostName w1.uxn-build.ald.nu\nPort 2222\nUser build\nStrictHostKeyChecking yes\nCheckHostIP no\n' > ~/.ssh/config
22
+    - build-linux: |
23
+        cd uxn
24
+        sed -i -e 's/.*Running.*/exit/' build.sh
25
+        ./build.sh
26
+        mv bin uxn
27
+        tar -czf ../out/uxn-linux-amd64.tar.gz uxn
28
+        cd ..
29
+    - build-windows: |
30
+        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); sed -i -e 's/.*Running.*/exit/' build.sh; MSYSTEM=MSYS ./build.sh; mv bin uxn; zip -qr ../uxn-windows-64bit.zip uxn"
31
+        rsync win:uxn-windows-64bit.zip out/
32
+    - upload: |
33
+        ls -l out
34
+        tar -czf out.tar.gz -C out uxn-linux-amd64.tar.gz uxn-windows-64bit.zip
35
+        acurl() {
36
+            set +x
37
+            curl -H "Authorization: Bearer ${OAUTH2_TOKEN}" "${@}"
38
+            set -x
39
+        }
40
+        acurl -f "https://pages.sr.ht/publish/${SITE}" -Fcontent=@out.tar.gz
41
+        acurl -f "https://pages.sr.ht/publish/${SITE}" -Fcontent=@out.tar.gz -Fprotocol=GEMINI
... ...
@@ -2,6 +2,10 @@
2 2
 
3 3
 An assembler and emulator for the [Uxn stack-machine](https://wiki.xxiivv.com/site/uxn.html), written in ANSI C. 
4 4
 
5
+## Download binaries
6
+
7
+Binaries are available for 64-bit x86 computers running [Linux](https://rabbits.srht.site/uxn-linux-amd64.tar.gz) and [Windows](https://rabbits.srht.site/uxn-windows-64bit.zip).
8
+
5 9
 ## Build
6 10
 
7 11
 ### Linux/OS X