-
Notifications
You must be signed in to change notification settings - Fork 182
64 lines (63 loc) · 2.5 KB
/
webgl-update.yml
File metadata and controls
64 lines (63 loc) · 2.5 KB
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
name: Update WebGL Build
on:
schedule:
- cron: 0 8 * * *
workflow_dispatch:
jobs:
Do-The-Thing:
runs-on: ubuntu-latest
container:
image: sharkwouter/pspdev
steps:
- uses: actions/checkout@v3
with:
ref: ${{ github.head_ref }}
- name: Get apt ready
run: |
apt update
apt install -y zip unzip wget curl git jq bash ffmpeg
- name: Download assets
run: |
git config --global --add safe.directory $GITHUB_WORKSPACE
cd $GITHUB_WORKSPACE
wget -nc https://github.com/nzp-team/fteqw/releases/download/bleeding-edge/pc-nzp-web.zip
wget -nc https://github.com/nzp-team/assets/releases/download/newest/pc-nzp-assets.zip
wget -nc https://github.com/nzp-team/quakec/releases/download/bleeding-edge/fte-nzp-qc.zip
wget -nc https://github.com/nzp-team/nzportable/releases/download/nightly/build-version.txt
- name: Create .PK3
run: |
cd $GITHUB_WORKSPACE
rm nzp/*.pk3
mkdir tmp
unzip -q pc-nzp-assets.zip -d tmp/
mv build-version.txt tmp/nzp/version.txt
cd tmp/nzp/tracks
find . -name '*.ogg' -exec bash -c 'ffmpeg -i $1 -acodec pcm_u8 -ar 16000 ${1%.*}.wav' -- {} \;
find . -name "*.mp3" -type f -delete
find . -name "*.ogg" -type f -delete
cd ../
zip -r ../../nzp/game.pk3 ./*
cd ../../
unzip -q fte-nzp-qc.zip -d tmp/nzp
cd tmp/nzp
zip -r ../../nzp/progs.pk3 ./*.dat ./*.lno
- name: Replace WebAssembly files
run: |
cd $GITHUB_WORKSPACE
unzip -q pc-nzp-web.zip -d tmp/
mv tmp/ftewebgl.wasm ./
mv tmp/ftewebgl.js ./
- name: Trash stuff
run: |
cd $GITHUB_WORKSPACE
rm -rf tmp/
rm pc-nzp-web.zip
rm pc-nzp-assets.zip
rm fte-nzp-qc.zip
- name: Commit and Push
uses: stefanzweifel/git-auto-commit-action@v4
with:
commit_message: Update NZ:P
branch: main
commit_user_name: Awesome NZ:P Updater Bot
commit_user_email: nope@example.org