-
-
Notifications
You must be signed in to change notification settings - Fork 24
81 lines (66 loc) · 3.38 KB
/
ReleaseBuilds-aarch64.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
77
78
79
80
81
name: Make Release Builds (linux/aarch64)
on: [workflow_dispatch]
jobs:
build-linux-appimage-aarch64:
runs-on: ubuntu-20.04
timeout-minutes: 100 # this job may take up to an hour
steps:
- uses: actions/checkout@v4
with: {submodules: 'recursive'}
# Create shared directory ON HOST. (If it's done within qemu, it'll be created with root permissions)
- name: Create artifacts directory shared with docker
run: |
mkdir -p "artifacts"
# QEMU can't run appimagetool-aarch64, so we have to build the AppImage on x86_64
- name: Download appimagetool
run : |
pushd artifacts
wget -q https://github.com/AppImage/AppImageKit/releases/download/13/appimagetool-x86_64.AppImage
wget -q https://github.com/AppImage/AppImageKit/releases/download/13/runtime-aarch64
chmod +x appimagetool-x86_64.AppImage
chmod +x runtime-aarch64
popd
- uses: uraimo/run-on-arch-action@v2
name: Build game via QEMU
id: buildgame
with:
arch: aarch64
# Distro must be kept in sync with `runs-on` above.
# See: https://github.com/uraimo/run-on-arch-action#supported-platforms
distro: ubuntu20.04
# (Optional) Speeds up builds by storing container images in a GitHub package registry.
githubToken: ${{ github.token }}
# Mount the artifacts directory as /artifacts in the container
dockerRunArgs: |
--volume "${PWD}/artifacts:/artifacts"
# Install build tools for the game and SDL build dependencies.
# See: https://github.com/libsdl-org/SDL/blob/main/docs/README-linux.md (last updated for SDL 2.26.0)
install: |
apt update -y
apt install -y build-essential cmake
#apt install -y libsdl2-dev #----- for quick testing
apt install -y libasound2-dev libpulse-dev \
libaudio-dev libjack-dev libsndio-dev libsamplerate0-dev libx11-dev libxext-dev \
libxrandr-dev libxcursor-dev libxfixes-dev libxi-dev libxss-dev libwayland-dev \
libxkbcommon-dev libdrm-dev libgbm-dev libgl1-mesa-dev libgles2-mesa-dev \
libegl1-mesa-dev libdbus-1-dev libibus-1.0-dev libudev-dev fcitx-libs-dev
# Build the aarch64 version under dist/, then tar it up and move it to /artifacts.
# (We're not building directly in /artifacts as this would cause permission issues when moving back to the x86_64 host)
run: |
#python3 build.py --system-sdl --no-appimage #----- for quick testing
python3 build.py --no-appimage
cd dist
tar cvf /artifacts/aarch64-dist.tar ./*.AppDir
# QEMU can't run appimagetool-aarch64, so we have to build the AppImage on x86_64
- name: Create AppImage on x86_64 host
run: |
cd artifacts
tar xvf aarch64-dist.tar
APPIMAGE_INPUT=$(ls -d --indicator-style=none *.AppDir)
APPIMAGE_OUTPUT=${APPIMAGE_INPUT%.AppDir}.AppImage
echo "APPIMAGE_OUTPUT=$APPIMAGE_OUTPUT" >> $GITHUB_ENV
./appimagetool-x86_64.AppImage -v --runtime-file runtime-aarch64 --no-appstream $APPIMAGE_INPUT $APPIMAGE_OUTPUT
- uses: actions/upload-artifact@v3
with:
name: ${{ env.APPIMAGE_OUTPUT }}
path: artifacts/${{ env.APPIMAGE_OUTPUT }}