-
Notifications
You must be signed in to change notification settings - Fork 1
364 lines (364 loc) · 13.9 KB
/
build.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
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
on: [push]
jobs:
zlib-mingw32:
runs-on: ubuntu-latest
steps:
- name: Install mingw-w64
run: |
sudo apt-get update
sudo DEBIAN_FRONTEND=noninteractive apt-get install -yq --no-install-recommends mingw-w64
- name: Checkout
uses: actions/checkout@v4
- name: Checkout zlib
uses: actions/checkout@v4
with:
repository: madler/zlib
ref: master
path: zlib
- name: Configure zlib
run: |
CMAKE_TOOLCHAIN_FILE=${{github.workspace}}/mingw.cmake \
CMAKE_BUILD_TYPE=Release cmake \
-B ${{github.workspace}}/zlib/build \
-S ${{github.workspace}}/zlib
- name: Build zlib
run: cmake --build ${{github.workspace}}/zlib/build --config Release
- name: Configure minizip
run: |
cp ${{github.workspace}}/zlib/build/zconf.h ${{github.workspace}}/zlib/
cd ${{github.workspace}}/zlib/contrib/minizip && autoreconf -fvi
cd ${{github.workspace}}/zlib/contrib/minizip && CFLAGS="-m32 -march=x86-64" ./configure --host=i686-w64-mingw32
- name: Build minizip
run: |
make -C ${{github.workspace}}/zlib/contrib/minizip
- name: Package files
run: |
mkdir -p ${{github.workspace}}/zlib/build/include/minizip
cp ${{github.workspace}}/zlib/contrib/minizip/.libs/libminizip.a ${{github.workspace}}/zlib/build/
cp ${{github.workspace}}/zlib/*.h ${{github.workspace}}/zlib/build/include/
cp ${{github.workspace}}/zlib/contrib/minizip/*.h ${{github.workspace}}/zlib/build/include/minizip/
cp ${{github.workspace}}/zlib/build/zconf.h ${{github.workspace}}/zlib/build/include/
mv ${{github.workspace}}/zlib/build/libzlibstatic.a ${{github.workspace}}/zlib/build/libz.a
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: zlib-mingw32
path: |
${{github.workspace}}/zlib/build/include
${{github.workspace}}/zlib/build/libz.a
${{github.workspace}}/zlib/build/libminizip.a
enet-mingw32:
runs-on: ubuntu-latest
steps:
- name: Install mingw-w64
run: |
sudo apt-get update
sudo DEBIAN_FRONTEND=noninteractive apt-get install -yq --no-install-recommends mingw-w64
- name: Checkout
uses: actions/checkout@v4
- name: Checkout enet
uses: actions/checkout@v4
with:
repository: lsalzman/enet
ref: master
path: enet
- name: Configure
run: |
CMAKE_TOOLCHAIN_FILE=${{github.workspace}}/mingw.cmake \
CMAKE_BUILD_TYPE=Release cmake \
-B ${{github.workspace}}/enet/build \
-S ${{github.workspace}}/enet
- name: Build
run: cmake --build ${{github.workspace}}/enet/build --config Release
- name: Package files
run:
cp -r ${{github.workspace}}/enet/include ${{github.workspace}}/enet/build/
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: enet-mingw32
path: |
${{github.workspace}}/enet/build/include
${{github.workspace}}/enet/build/libenet.a
spng-mingw32:
runs-on: ubuntu-latest
needs: zlib-mingw32
steps:
- name: Install mingw-w64
run: |
sudo apt-get update
sudo DEBIAN_FRONTEND=noninteractive apt-get install -yq --no-install-recommends mingw-w64
- name: Checkout
uses: actions/checkout@v4
- name: Checkout libspng
uses: actions/checkout@v4
with:
repository: randy408/libspng
ref: master
path: libspng
- name: Download zlib
uses: actions/download-artifact@v4
with:
name: zlib-mingw32
path: ${{github.workspace}}/zlib
- name: Configure
run: |
CMAKE_TOOLCHAIN_FILE=${{github.workspace}}/mingw.cmake \
CMAKE_BUILD_TYPE=Release SPNG_SHARED=OFF BUILD_EXAMPLES=OFF cmake \
-B ${{github.workspace}}/libspng/build \
-S ${{github.workspace}}/libspng \
-DZLIB_INCLUDE_DIR=${{github.workspace}}/zlib/include \
-DZLIB_LIBRARY=${{github.workspace}}/zlib/libz.a
- name: Build
run: cmake --build ${{github.workspace}}/libspng/build --config Release
- name: Package files
run: |
mkdir -p ${{github.workspace}}/libspng/build/include/
cp ${{github.workspace}}/libspng/spng/*.h ${{github.workspace}}/libspng/build/include/
mv ${{github.workspace}}/libspng/build/libspng_static.a ${{github.workspace}}/libspng/build/libspng.a
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: spng-mingw32
path: |
${{github.workspace}}/libspng/build/include/*.h
${{github.workspace}}/libspng/build/libspng.a
centijson-mingw32:
runs-on: ubuntu-latest
steps:
- name: Install mingw-w64
run: |
sudo apt-get update
sudo DEBIAN_FRONTEND=noninteractive apt-get install -yq --no-install-recommends mingw-w64
- name: Checkout
uses: actions/checkout@v4
- name: Checkout centijson
uses: actions/checkout@v4
with:
repository: mity/centijson
ref: master
path: centijson
- name: Configure
run: |
CMAKE_TOOLCHAIN_FILE=${{github.workspace}}/mingw.cmake \
CMAKE_BUILD_TYPE=Release cmake \
-B ${{github.workspace}}/centijson/build \
-S ${{github.workspace}}/centijson
- name: Build
run: cmake --build ${{github.workspace}}/centijson/build --config Release
- name: Package files
run: |
mkdir -p ${{github.workspace}}/centijson/build/include/
cp ${{github.workspace}}/centijson/src/*.h ${{github.workspace}}/centijson/build/include/
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: centijson-mingw32
path: |
${{github.workspace}}/centijson/build/include
${{github.workspace}}/centijson/build/libjson.a
astronomy-mingw32:
runs-on: ubuntu-latest
steps:
- name: Install mingw-w64
run: |
sudo apt-get update
sudo DEBIAN_FRONTEND=noninteractive apt-get install -yq --no-install-recommends mingw-w64
- name: Checkout
uses: actions/checkout@v4
- name: Checkout astronomy
uses: actions/checkout@v4
with:
repository: cosinekitty/astronomy
ref: master
path: astronomy
- name: Apply patches
run: |
cd ${{github.workspace}}/astronomy && git apply ${{github.workspace}}/astronomy-356.patch
cd ${{github.workspace}}/astronomy && git apply ${{github.workspace}}/astronomy-357.patch
- name: Build
run: |
mkdir -p ${{github.workspace}}/astronomy/build
i686-w64-mingw32-gcc -m32 -march=x86-64 -c \
-I ${{github.workspace}}/astronomy/source/c \
-o ${{github.workspace}}/astronomy/build/astronomy.o \
${{github.workspace}}/astronomy/source/c/astronomy.c
i686-w64-mingw32-ar crs \
${{github.workspace}}/astronomy/build/libastronomy.a \
${{github.workspace}}/astronomy/build/astronomy.o
- name: Package files
run: |
mkdir -p ${{github.workspace}}/astronomy/build/include/
cp ${{github.workspace}}/astronomy/source/c/*.h ${{github.workspace}}/astronomy/build/include/
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: astronomy-mingw32
path: |
${{github.workspace}}/astronomy/build/include
${{github.workspace}}/astronomy/build/libastronomy.a
tomlc99-mingw32:
runs-on: ubuntu-latest
steps:
- name: Install mingw-w64
run: |
sudo apt-get update
sudo DEBIAN_FRONTEND=noninteractive apt-get install -yq --no-install-recommends mingw-w64
- name: Checkout
uses: actions/checkout@v4
- name: Checkout tomlc99
uses: actions/checkout@v4
with:
repository: cktan/tomlc99
ref: master
path: tomlc99
- name: Build
run: |
CC=i686-w64-mingw32-gcc CFLAGS="-m32 -march=x86-64" make -C ${{github.workspace}}/tomlc99 libtoml.a
- name: Package files
run: |
mkdir -p ${{github.workspace}}/tomlc99/build/include/
cp ${{github.workspace}}/tomlc99/*.h ${{github.workspace}}/tomlc99/build/include/
cp ${{github.workspace}}/tomlc99/libtoml.a ${{github.workspace}}/tomlc99/build/
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: tomlc99-mingw32
path: |
${{github.workspace}}/tomlc99/build/include
${{github.workspace}}/tomlc99/build/libtoml.a
ffmpeg-mingw32:
runs-on: ubuntu-latest
steps:
- name: Install mingw-w64
run: |
sudo apt-get update
sudo DEBIAN_FRONTEND=noninteractive apt-get install -yq --no-install-recommends mingw-w64
- name: Checkout
uses: actions/checkout@v4
- name: Checkout ffmpeg
uses: actions/checkout@v4
with:
repository: FFmpeg/FFmpeg
ref: master
path: ffmpeg
- name: Configure
run: |
cd ${{github.workspace}}/ffmpeg && ./configure \
--disable-x86asm \
--disable-programs \
--disable-doc \
--disable-devices \
--disable-everything \
--disable-filters \
--disable-static \
--disable-avdevice \
--disable-swscale \
--disable-postproc \
--disable-avfilter \
--disable-network \
--disable-dwt \
--disable-lsp \
--disable-faan \
--disable-iamf \
--disable-pixelutils \
--disable-debug \
--enable-shared \
--enable-small \
--enable-decoder=smacker \
--enable-decoder=smackaud \
--enable-demuxer=smacker \
--enable-protocol=file \
--arch=i686 \
--target-os=mingw32 \
--cross-prefix=i686-w64-mingw32- \
--enable-cross-compile
- name: Build
run: |
make -C ${{github.workspace}}/ffmpeg \
libavformat/libavformat.a \
libavcodec/libavcodec.a \
libavutil/libavutil.a \
libswresample/libswresample.a
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: ffmpeg-mingw32
path: |
${{github.workspace}}/ffmpeg/libavformat/*.h
${{github.workspace}}/ffmpeg/libavformat/libavformat.a
${{github.workspace}}/ffmpeg/libavcodec/*.h
${{github.workspace}}/ffmpeg/libavcodec/libavcodec.a
${{github.workspace}}/ffmpeg/libavutil/*.h
${{github.workspace}}/ffmpeg/libavutil/libavutil.a
${{github.workspace}}/ffmpeg/libswresample/*.h
${{github.workspace}}/ffmpeg/libswresample/libswresample.a
release:
if: startsWith(github.ref, 'refs/tags/')
runs-on: ubuntu-latest
needs:
- zlib-mingw32
- centijson-mingw32
- astronomy-mingw32
- enet-mingw32
- spng-mingw32
- tomlc99-mingw32
- ffmpeg-mingw32
steps:
- name: Download zlib
uses: actions/download-artifact@v4
with:
name: zlib-mingw32
path: ${{github.workspace}}/zlib
- name: Download centijson
uses: actions/download-artifact@v4
with:
name: centijson-mingw32
path: ${{github.workspace}}/centijson
- name: Download astronomy
uses: actions/download-artifact@v4
with:
name: astronomy-mingw32
path: ${{github.workspace}}/astronomy
- name: Download enet
uses: actions/download-artifact@v4
with:
name: enet-mingw32
path: ${{github.workspace}}/enet
- name: Download spng
uses: actions/download-artifact@v4
with:
name: spng-mingw32
path: ${{github.workspace}}/spng
- name: Download tomlc99
uses: actions/download-artifact@v4
with:
name: tomlc99-mingw32
path: ${{github.workspace}}/tomlc99
- name: Download ffmpeg
uses: actions/download-artifact@v4
with:
name: ffmpeg-mingw32
path: ${{github.workspace}}/ffmpeg
- name: Create tarballs
run: |
tar czf ${{github.workspace}}/zlib-mingw32.tar.gz -C ${{github.workspace}}/zlib .
tar czf ${{github.workspace}}/centijson-mingw32.tar.gz -C ${{github.workspace}}/centijson .
tar czf ${{github.workspace}}/astronomy-mingw32.tar.gz -C ${{github.workspace}}/astronomy .
tar czf ${{github.workspace}}/enet-mingw32.tar.gz -C ${{github.workspace}}/enet .
tar czf ${{github.workspace}}/spng-mingw32.tar.gz -C ${{github.workspace}}/spng .
tar czf ${{github.workspace}}/tomlc99-mingw32.tar.gz -C ${{github.workspace}}/tomlc99 .
tar czf ${{github.workspace}}/ffmpeg-mingw32.tar.gz -C ${{github.workspace}}/ffmpeg .
- name: Release
uses: softprops/action-gh-release@v2
with:
token: ${{ secrets.GA_TEST_TOKEN }}
make_latest: true
files: |
${{github.workspace}}/zlib-mingw32.tar.gz
${{github.workspace}}/centijson-mingw32.tar.gz
${{github.workspace}}/astronomy-mingw32.tar.gz
${{github.workspace}}/enet-mingw32.tar.gz
${{github.workspace}}/spng-mingw32.tar.gz
${{github.workspace}}/tomlc99-mingw32.tar.gz
${{github.workspace}}/ffmpeg-mingw32.tar.gz