forked from mkxp-z/mkxp-z
-
Notifications
You must be signed in to change notification settings - Fork 1
301 lines (267 loc) · 12 KB
/
autobuild.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
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
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
# I have no idea what I'm doing
name: Automatic Build
on:
push:
branches: ['dev', 'autobuild']
paths-ignore: ['*.md', '*.json', '*.png']
pull_request:
branches: ['dev', 'autobuild']
paths-ignore: ['*.md', '*.json', '*.png']
jobs:
build-windows:
name: Windows
runs-on: windows-latest
steps:
- uses: benjlevesque/[email protected]
id: short-sha
with:
length: 7
- uses: msys2/setup-msys2@v2
with:
msystem: UCRT64
install: >-
base-devel
git
ruby
vim
mingw-w64-ucrt-x86_64-cmake
mingw-w64-ucrt-x86_64-meson
mingw-w64-ucrt-x86_64-autotools
mingw-w64-ucrt-x86_64-gcc
mingw-w64-ucrt-x86_64-boost
mingw-w64-ucrt-x86_64-egl-headers
mingw-w64-ucrt-x86_64-gles-headers
zip
- name: Checkout repository
uses: actions/checkout@v3
- uses: actions/cache@v3
with:
path: |
windows/build-ucrt64
windows/downloads
key: win-${{ hashFiles('windows/Makefile') }}
- name: Build all dependencies
shell: msys2 {0}
run: |
cd windows
make
- name: Build exe
shell: msys2 {0}
run: |
source windows/vars.sh
meson setup build
cd build
ninja
strip ./oneshot.exe
- name: Prepare archive
shell: msys2 {0}
run: |
mkdir build/out
mkdir build/out/lib
cd build/out/
cp /ucrt64/bin/zlib1.dll ./lib
cp ../../windows/build-ucrt64/bin/x64-ucrt-ruby310.dll .
cp -r ../../windows/build-ucrt64/lib/ruby/3.1.0 .
mv ./3.1.0 ./lib/ruby
cp ../oneshot.exe ./lib
cp ../oneshot-shim.exe ./oneshot.exe
cp ../journal/_______.exe .
cp ../../mkxp.json .
cp ../../assets/LICENSE.mkxp-z-with-https.txt .
cd ..
# Zipping before uploading decreases the upload time considerably.
# Unfortunately this results in double-zipping; tracked at:
# https://github.com/actions/upload-artifact/issues/426
zip -r artifact.zip artifact
- uses: actions/upload-artifact@v3
with:
name: mkxp-z.windows.${{github.event_name == 'pull_request' && format('PR{0}', github.event.number) || github.ref_name}}-${{steps.short-sha.outputs.sha}}
path: |
build/out
build-linux-native:
name: Ubuntu 22.04 x86_64
runs-on: ubuntu-22.04
steps:
- uses: benjlevesque/[email protected]
id: short-sha
with:
length: 7
- name: Checkout repository
uses: actions/checkout@v3
- uses: actions/cache@v3
with:
path: |
linux/build-x86_64
linux/downloads
key: lin-x86_64-${{ hashFiles('linux/Makefile') }}
- name: Install apt dependencies
run: |
sudo apt update
sudo apt install git build-essential cmake meson autoconf automake libtool pkg-config ruby bison zlib1g-dev libbz2-dev xorg-dev libgl1-mesa-dev libasound2-dev libpulse-dev libxfconf-0-dev libgtk-3-dev libboost-dev -y
- name: Build everything else
run: |
cd linux
make
- name: Build executable
run: |
source linux/vars.sh
meson build --bindir=. --prefix=$GITHUB_WORKSPACE/build/lib
cd build
ninja
ninja install
- name: Prepare archive
run: |
cd build/lib
cp -r ../../linux/build-x86_64/lib/ruby/3.1.0 .
mv ./3.1.0 ./ruby
cp ../../mkxp.json .
cp -r ../../scripts .
cp ../../assets/LICENSE.mkxp-z-with-https.txt .
cd ..
zip -r lib.zip lib
- uses: actions/upload-artifact@v3
with:
name: mkxp-z.linux.x86_64.${{github.event_name == 'pull_request' && format('PR{0}', github.event.number) || github.ref_name}}-${{steps.short-sha.outputs.sha}}
path: build/lib.zip
# build-linux-cross:
# name: Ubuntu 22.04 ${{matrix.arch_mkxpz}}
# runs-on: ubuntu-22.04
# continue-on-error: ${{ matrix.experimental }}
# strategy:
# fail-fast: false
# matrix:
# include:
# - arch_mkxpz: armv6
# arch_debian: armhf
# arch_gcc: arm-linux-gnueabihf
# experimental: false
# - arch_mkxpz: armv7
# arch_debian: armhf
# arch_gcc: arm-linux-gnueabihf
# experimental: false
# - arch_mkxpz: armv7-neon
# arch_debian: armhf
# arch_gcc: arm-linux-gnueabihf
# experimental: false
# - arch_mkxpz: arm64
# arch_debian: arm64
# arch_gcc: aarch64-linux-gnu
# experimental: false
# - arch_mkxpz: power8le
# arch_debian: ppc64el
# arch_gcc: powerpc64le-linux-gnu
# experimental: false
# - arch_mkxpz: power9le
# arch_debian: ppc64el
# arch_gcc: powerpc64le-linux-gnu
# experimental: false
# - arch_mkxpz: s390x
# arch_debian: s390x
# arch_gcc: s390x-linux-gnu
# # src/util/serial-util.h errors on big-endian targets.
# experimental: true
# - arch_mkxpz: riscv64
# arch_debian: riscv64
# arch_gcc: riscv64-linux-gnu
# # libjxl/highway compatibility issue, TODO check if fixed in later SDL_image.
# # Also probably an OpenSSL arch name issue, which might be fixed by now.
# experimental: true
# steps:
# - uses: benjlevesque/[email protected]
# id: short-sha
# with:
# length: 7
# - name: Checkout repository
# uses: actions/checkout@v3
# - uses: actions/cache@v3
# with:
# path: |
# linux/build-${{matrix.arch_mkxpz}}
# linux/downloads
# key: lin-${{matrix.arch_mkxpz}}-${{ hashFiles('linux/Makefile', 'linux/target*', 'linux/toolchain*') }}
# - name: Install apt dependencies
# run: |
# sudo sed -i "s/deb /deb [arch=amd64] /g" /etc/apt/sources.list
# sudo dpkg --add-architecture ${{matrix.arch_debian}}
# echo "deb [arch=${{matrix.arch_debian}}] http://ports.ubuntu.com/ jammy main restricted" | sudo tee -a /etc/apt/sources.list
# echo "deb [arch=${{matrix.arch_debian}}] http://ports.ubuntu.com/ jammy-updates main restricted" | sudo tee -a /etc/apt/sources.list
# echo "deb [arch=${{matrix.arch_debian}}] http://ports.ubuntu.com/ jammy universe" | sudo tee -a /etc/apt/sources.list
# echo "deb [arch=${{matrix.arch_debian}}] http://ports.ubuntu.com/ jammy-updates universe" | sudo tee -a /etc/apt/sources.list
# echo "deb [arch=${{matrix.arch_debian}}] http://ports.ubuntu.com/ jammy multiverse" | sudo tee -a /etc/apt/sources.list
# echo "deb [arch=${{matrix.arch_debian}}] http://ports.ubuntu.com/ jammy-updates multiverse" | sudo tee -a /etc/apt/sources.list
# echo "deb [arch=${{matrix.arch_debian}}] http://ports.ubuntu.com/ jammy-backports main restricted universe multiverse" | sudo tee -a /etc/apt/sources.list
# sudo apt update
# sudo apt install git build-essential cmake meson autoconf automake libtool pkg-config ruby bison -y
# sudo apt install libdmx-dev:${{matrix.arch_debian}} libfontenc-dev:${{matrix.arch_debian}} libfs-dev:${{matrix.arch_debian}} libice-dev:${{matrix.arch_debian}} libsm-dev:${{matrix.arch_debian}} libx11-dev:${{matrix.arch_debian}} libxau-dev:${{matrix.arch_debian}} libxaw7-dev:${{matrix.arch_debian}} libxcomposite-dev:${{matrix.arch_debian}} libxcursor-dev:${{matrix.arch_debian}} libxdamage-dev:${{matrix.arch_debian}} libxdmcp-dev:${{matrix.arch_debian}} libxext-dev:${{matrix.arch_debian}} libxfixes-dev:${{matrix.arch_debian}} libxfont-dev:${{matrix.arch_debian}} libxft-dev:${{matrix.arch_debian}} libxi-dev:${{matrix.arch_debian}} libxinerama-dev:${{matrix.arch_debian}} libxkbfile-dev:${{matrix.arch_debian}} libxmu-dev:${{matrix.arch_debian}} libxmuu-dev:${{matrix.arch_debian}} libxpm-dev:${{matrix.arch_debian}} libxrandr-dev:${{matrix.arch_debian}} libxrender-dev:${{matrix.arch_debian}} libxres-dev:${{matrix.arch_debian}} libxss-dev:${{matrix.arch_debian}} libxt-dev:${{matrix.arch_debian}} libxtst-dev:${{matrix.arch_debian}} libxv-dev:${{matrix.arch_debian}} libxvmc-dev:${{matrix.arch_debian}} libxxf86dga-dev:${{matrix.arch_debian}} libxxf86vm-dev:${{matrix.arch_debian}} x11proto-dev:${{matrix.arch_debian}} xserver-xorg-dev:${{matrix.arch_debian}} xtrans-dev:${{matrix.arch_debian}} -y
# sudo apt install gcc-${{matrix.arch_gcc}} g++-${{matrix.arch_gcc}} zlib1g-dev:${{matrix.arch_debian}} libbz2-dev:${{matrix.arch_debian}} libgl1-mesa-dev:${{matrix.arch_debian}} libasound2-dev:${{matrix.arch_debian}} libpulse-dev:${{matrix.arch_debian}} -y
# - name: Build everything else
# run: |
# cd linux
# source target-${{matrix.arch_mkxpz}}.sh
# make
# - name: Build executable
# run: |
# source linux/target-${{matrix.arch_mkxpz}}.sh
# source linux/vars.sh
# meson setup --cross-file linux/$ARCH_MESON_TOOLCHAIN build --bindir=. --prefix=$GITHUB_WORKSPACE/build/local
# cd build
# ninja
# ninja install
# cp "$MKXPZ_PREFIX/lib/$("$ARCH_CONFIGURE-objdump" -p local/mkxp-z* | grep -i NEEDED | grep -Eo 'libruby.so.[0-9\.]+')" local/lib*/
# cp "/usr/lib/$ARCH_CONFIGURE/$("$ARCH_CONFIGURE-objdump" -p local/lib*/libruby.so* | grep -i NEEDED | grep -Eo 'libcrypt.so.[0-9\.]+')" local/lib*/
# - name: Prepare archive
# run: |
# cd build/local
# cp -r ../../linux/build-${{matrix.arch_mkxpz}}/lib/ruby/3.1.0 .
# mv ./3.1.0 ./stdlib
# cp ../../mkxp.json .
# cp -r ../../scripts .
# cp ../../assets/LICENSE.mkxp-z-with-https.txt .
# cd ..
# zip -r local.zip local
# - uses: actions/upload-artifact@v3
# with:
# name: mkxp-z.linux.${{matrix.arch_mkxpz}}.${{github.event_name == 'pull_request' && format('PR{0}', github.event.number) || github.ref_name}}-${{steps.short-sha.outputs.sha}}
# path: build/local.zip
# build-macos:
# name: macOS
# runs-on: macos-latest
# steps:
# - uses: benjlevesque/[email protected]
# id: short-sha
# with:
# length: 7
# - name: Remove pre-existing homebrew packages
# run: brew remove --force $(brew list)
# - name: Checkout repository
# uses: actions/checkout@v3
# - uses: actions/cache@v3
# with:
# path: |
# macos/Dependencies/build-macosx-x86_64
# macos/Dependencies/build-macosx-arm64
# macos/Dependencies/build-macosx-universal
# macos/Dependencies/downloads
# key: mac-${{ hashFiles('macos/Dependencies/*.make', 'macos/Dependencies/*.sh') }}
# - name: Install Homebrew tools
# run: |
# cd macos/Dependencies
# brew bundle
# - name: Build all dependencies
# run: |
# cd macos/Dependencies
# ./setup.sh
# - name: Build app
# run: |
# cd macos
# xcodebuild -project mkxp-z.xcodeproj -configuration "Release" -scheme "Universal" -derivedDataPath "$GITHUB_WORKSPACE/build"
# - name: Compress app
# run: |
# cd build/Build/Products/Release
# cp ../../../../assets/LICENSE.mkxp-z-with-https.txt ./Z-universal.app/
# ditto -c -k --sequesterRsrc --keepParent Z-universal.app Z-universal.app.zip
# - name: Upload archive
# uses: actions/upload-artifact@v3
# with:
# name: mkxp-z.macos.${{github.event_name == 'pull_request' && format('PR{0}', github.event.number) || github.ref_name}}-${{steps.short-sha.outputs.sha}}
# path: build/Build/Products/Release/Z-universal.app.zip