-
Notifications
You must be signed in to change notification settings - Fork 54
76 lines (69 loc) · 2.65 KB
/
build_zeal8bitos.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
name: Build Zeal 8-bit OS
on:
push:
branches:
- main
jobs:
deploy:
if: github.repository_owner == 'Zeal8bit'
runs-on: ubuntu-22.04
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
steps:
- name: Checkout from git
uses: actions/checkout@v3
with:
submodules: 'true' # future use
fetch-depth: 0
- name: Install prerequisites
shell: bash
run: |
sudo snap remove z88dk
sudo snap install --edge z88dk
sudo snap alias z88dk.z88dk-z80asm z88dk-z80asm
sudo apt install -y jq make lftp
- name: Build Zeal 8-bit OS (zeal8bit target)
shell: bash
run: |
wget $CONF_SERVER/roms/config/os.conf
wget $CONF_SERVER/roms/config/osconfig.asm
mv osconfig.asm include/
z88dk-z80asm
make
mv build/os_with_romdisk.img build/$(git describe --tags).img
env:
CONF_SERVER: ${{ secrets.ZEAL8BIT_CONF_SITE }}
- name: Update index.json
shell: bash
run: |
wget $CONF_SERVER/roms/index.json
export NAME=$(git describe --tags)
export SHA=$(sha256sum -b build/*.img | cut -f1 -d' ')
jq ".nightly += [.latest] | .latest = {\"name\" : \"$NAME\", \
\"urls\" : \"$CONF_SERVER/roms/$NAME.img\", \
\"version\" : \"$NAME/\", \
\"hash\": \"$SHA\"}" < index.json > index_new.json
mv index_new.json index.json
env:
CONF_SERVER: ${{ secrets.ZEAL8BIT_CONF_SITE }}
- name: Setup SSH
shell: bash
run: |
mkdir -p ~/.ssh
echo "StrictHostKeyChecking no" > ~/.ssh/config
echo "$RUNNER_SSH_PRIV" > ~/.ssh/id_rsa
echo "$RUNNER_SSH_PUB" > ~/.ssh/id_rsa.pub
sudo sh -c 'echo "StrictHostKeyChecking no" >> /etc/ssh/ssh_config'
env:
RUNNER_SSH_PUB: ${{ secrets.ZEAL8BIT_SSH_PUB }}
RUNNER_SSH_PRIV: ${{ secrets.ZEAL8BIT_SSH_PRIV }}
- name: Publish files
shell: bash
run: |
export NAME=$(git describe --tags).img
lftp --env-password -d sftp://$LFTP_USER@$LFTP_SERVER -e "set sftp:auto-confirm yes; put -e build/$NAME -o /htdocs/roms/$NAME; put -e index.json -o /htdocs/roms/index.json; bye"
env:
LFTP_USER: ${{ secrets.ZEAL8BIT_USER }}
LFTP_SERVER: ${{ secrets.ZEAL8BIT_SERVER }}
LFTP_PORT: ${{ secrets.ZEAL8BIT_PORT }}
LFTP_PASSWORD: ${{ secrets.ZEAL8BIT_PASS }}