-
Notifications
You must be signed in to change notification settings - Fork 0
190 lines (162 loc) · 8.13 KB
/
Copy pathbuild.yml
File metadata and controls
190 lines (162 loc) · 8.13 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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
name: Build
on:
release:
types: [created]
jobs:
build:
runs-on: ${{matrix.os}}
strategy:
fail-fast: false
matrix:
system: [Linux, Darwin, Windows]
arch: [AMD64, ARM64]
include:
- system: Linux
os: ubuntu-22.04
- system: Darwin
os: macos-latest
- system: Windows
os: windows-latest
- arch: AMD64
cmake-arch: x86_64
apt-arch: amd64
- arch: ARM64
cmake-arch: arm64
apt-arch: arm64
steps:
- name: Checkout tools.
uses: actions/checkout@v4
- name: Set up environment for Linux.
if: matrix.system == 'Linux'
shell: bash
run: |
echo "SUDO=sudo" >> $GITHUB_ENV
echo "GENERATOR=Unix Makefiles" >> $GITHUB_ENV
if [ "${{matrix.cmake-arch}}" == "arm64" ]; then
echo "FLAGS=-DCMAKE_C_COMPILER=aarch64-linux-gnu-gcc" >> $GITHUB_ENV
sudo dpkg --add-architecture arm64
echo "deb [arch=amd64] http://security.ubuntu.com/ubuntu/ jammy main restricted universe multiverse" | sudo tee /etc/apt/sources.list
echo "deb [arch=arm64] http://ports.ubuntu.com/ubuntu-ports/ jammy main restricted universe multiverse" | sudo tee -a /etc/apt/sources.list
echo "deb [arch=amd64] http://security.ubuntu.com/ubuntu/ jammy-updates main restricted universe multiverse" | sudo tee -a /etc/apt/sources.list
echo "deb [arch=arm64] http://ports.ubuntu.com/ubuntu-ports/ jammy-updates main restricted universe multiverse" | sudo tee -a /etc/apt/sources.list
echo "deb [arch=amd64] http://security.ubuntu.com/ubuntu/ jammy-security main restricted universe multiverse" | sudo tee -a /etc/apt/sources.list
echo "deb [arch=arm64] http://ports.ubuntu.com/ubuntu-ports/ jammy-security main restricted universe multiverse" | sudo tee -a /etc/apt/sources.list
sudo apt-get update
sudo apt-get install -y gcc-aarch64-linux-gnu g++-aarch64-linux-gnu
else
echo "FLAGS=" >> $GITHUB_ENV
sudo apt-get update
fi
sudo apt-get install -y build-essential pkg-config cmake nasm libasound2-dev:${{matrix.apt-arch}} libpulse-dev:${{matrix.apt-arch}} libdecor-0-dev:${{matrix.apt-arch}} liburing-dev:${{matrix.apt-arch}} spirv-cross:${{matrix.apt-arch}} \
libaudio-dev:${{matrix.apt-arch}} libjack-dev:${{matrix.apt-arch}} libsndio-dev:${{matrix.apt-arch}} libx11-dev:${{matrix.apt-arch}} libxext-dev:${{matrix.apt-arch}} libfreetype6-dev:${{matrix.apt-arch}} spirv-tools:${{matrix.apt-arch}} \
libxrandr-dev:${{matrix.apt-arch}} libxcursor-dev:${{matrix.apt-arch}} libxfixes-dev:${{matrix.apt-arch}} libxi-dev:${{matrix.apt-arch}} libxss-dev:${{matrix.apt-arch}} libfreetype6:${{matrix.apt-arch}} libjbig0:${{matrix.apt-arch}} libxtst-dev:${{matrix.apt-arch}} \
libxkbcommon-dev:${{matrix.apt-arch}} libdrm-dev:${{matrix.apt-arch}} libgbm-dev:${{matrix.apt-arch}} libgl1-mesa-dev:${{matrix.apt-arch}} libgles2-mesa-dev:${{matrix.apt-arch}} linux-libc-dev:${{matrix.apt-arch}} libjbig-dev:${{matrix.apt-arch}} \
libegl1-mesa-dev:${{matrix.apt-arch}} libdbus-1-dev:${{matrix.apt-arch}} libibus-1.0-dev:${{matrix.apt-arch}} libudev-dev:${{matrix.apt-arch}} fcitx-libs-dev:${{matrix.apt-arch}} libpipewire-0.3-dev:${{matrix.apt-arch}} libwayland-dev:${{matrix.apt-arch}}
- name: Set up environment for Darwin.
if: matrix.system == 'Darwin'
shell: bash
run: |
echo "SUDO=sudo" >> $GITHUB_ENV
echo "FLAGS=-DCMAKE_ASM_COMPILER=clang -DCMAKE_OSX_ARCHITECTURES=${{matrix.cmake-arch}}" >> $GITHUB_ENV
echo "GENERATOR=Unix Makefiles" >> $GITHUB_ENV
if [ "${{matrix.cmake-arch}}" == "arm64" ]; then
BREW=/opt/homebrew/bin/brew
else
arch -arm64 /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/uninstall.sh)"
arch -${{matrix.cmake-arch}} /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
BREW=/usr/local/bin/brew
fi
arch -${{matrix.cmake-arch}} $BREW install cmake libsndfile portaudio libxrandr libxkbcommon spirv-cross spirv-headers spirv-tools \
libxi mesa libogg libvorbis opus wavpack libxmp webp libavif opusfile game-music-emu nasm freetype --force --overwrite || true
- name: Set up environment for Windows.
if: matrix.system == 'Windows'
shell: bash
run: |
echo "SUDO=" >> $GITHUB_ENV
echo "GENERATOR=Visual Studio 17 2022" >> $GITHUB_ENV
echo "C:/Program Files/NASM" >> $GITHUB_PATH
choco install pkgconfiglite nasm
if [ "${{matrix.cmake-arch}}" == "arm64" ]; then
echo "FLAGS=-A ARM64" >> $GITHUB_ENV
else
echo "FLAGS=-A x64" >> $GITHUB_ENV
fi
- name: Set up python.
uses: actions/setup-python@v5
with:
python-version: '3.13'
- name: Install dependencies.
shell: bash
run: |
python -m pip install --upgrade pip
python -m pip install --upgrade git+https://github.com/Aermoss/PySDL3.git
- name: Checkout modules.
shell: bash
run: |
python clone.py ${{github.event_name}}
env:
SDL_GITHUB_TOKEN: ${{secrets.PERSONAL_ACCESS_TOKEN}}
- name: Build SDL.
shell: bash
run: |
cd SDL
cmake -G "$GENERATOR" -S . -B build -DCMAKE_BUILD_TYPE=Release \
-DCMAKE_SYSTEM_NAME=${{matrix.system}} -DCMAKE_SYSTEM_PROCESSOR=${{matrix.cmake-arch}} $FLAGS
cmake --build build --config Release
$SUDO cmake --install build
- name: Build SDL_image.
shell: bash
run: |
cd SDL_image
cmake -G "$GENERATOR" -S . -B build -DCMAKE_BUILD_TYPE=Release \
-DCMAKE_SYSTEM_NAME=${{matrix.system}} -DCMAKE_SYSTEM_PROCESSOR=${{matrix.cmake-arch}} $FLAGS
cmake --build build --config Release
$SUDO cmake --install build
- name: Build SDL_mixer.
shell: bash
run: |
cd SDL_mixer
cmake -G "$GENERATOR" -S . -B build -DCMAKE_BUILD_TYPE=Release \
-DCMAKE_SYSTEM_NAME=${{matrix.system}} -DCMAKE_SYSTEM_PROCESSOR=${{matrix.cmake-arch}} $FLAGS
cmake --build build --config Release
$SUDO cmake --install build
- name: Build SDL_ttf.
shell: bash
run: |
cd SDL_ttf
cmake -G "$GENERATOR" -S . -B build -DCMAKE_BUILD_TYPE=Release \
-DCMAKE_SYSTEM_NAME=${{matrix.system}} -DCMAKE_SYSTEM_PROCESSOR=${{matrix.cmake-arch}} $FLAGS
cmake --build build --config Release
$SUDO cmake --install build
- name: Build SDL_rtf.
shell: bash
run: |
cd SDL_rtf
cmake -G "$GENERATOR" -S . -B build -DCMAKE_BUILD_TYPE=Release \
-DCMAKE_SYSTEM_NAME=${{matrix.system}} -DCMAKE_SYSTEM_PROCESSOR=${{matrix.cmake-arch}} $FLAGS
cmake --build build --config Release
$SUDO cmake --install build
- name: Build SDL_net.
shell: bash
run: |
cd SDL_net
cmake -G "$GENERATOR" -S . -B build -DCMAKE_BUILD_TYPE=Release \
-DCMAKE_SYSTEM_NAME=${{matrix.system}} -DCMAKE_SYSTEM_PROCESSOR=${{matrix.cmake-arch}} $FLAGS
cmake --build build --config Release
$SUDO cmake --install build
- name: Merge build artifacs.
shell: bash
run: |
python merge.py ${{github.event_name}}
env:
SDL_GITHUB_TOKEN: ${{secrets.PERSONAL_ACCESS_TOKEN}}
- name: Upload build artifacs.
if: github.event_name == 'release'
uses: actions/upload-release-asset@v1
with:
upload_url: ${{github.event.release.upload_url}}
asset_path: artifacts.zip
asset_name: ${{matrix.system}}-${{matrix.arch}}-${{github.event.release.tag_name}}.zip
asset_content_type: application/zip
env:
GITHUB_TOKEN: ${{secrets.PERSONAL_ACCESS_TOKEN}}