-
Notifications
You must be signed in to change notification settings - Fork 55
222 lines (201 loc) · 8.04 KB
/
release.yaml
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
name: Release
on:
push:
tags:
- tmx_** # Releases
env:
# Latest (2.9.10): https://gitlab.gnome.org/GNOME/libxml2/-/issues/154
libxml2_ver: v2.9.9
LIBXML2_CONFIGURE_FLAGS: '--without-c14n --without-catalog --without-debug --without-docbook --without-ftp
--without-http --without-html --without-xpath --without-xptr --without-xinclude --without-iconv --without-icu
--without-iso8859x --without-zlib --without-lzma --without-mem_debug --without-run_debug --without-schemas
--without-schematron --without-regexps --without-modules --without-pattern --without-push --without-valid
--without-sax1 --without-legacy --without-output --without-python
--with-tree --with-writer --with-reader
--disable-shared --enable-static'
zlib_ver: v1.2.11
jobs:
linux64:
name: Linux 64 Build
runs-on: ubuntu-20.04
steps:
# context expressions lack the most basic string manipulation functions...
- name: Create distribution folder
run: |
ARTIFACT_NAME=${GITHUB_REF:10}-linux
DIST_PATH=${GITHUB_WORKSPACE}/${ARTIFACT_NAME}
echo "ARTIFACT_NAME=${ARTIFACT_NAME}" >> $GITHUB_ENV
echo "DIST_PATH=${DIST_PATH}" >> $GITHUB_ENV
mkdir "${DIST_PATH}"
# Build and install zlib
- name: Checkout zlib
uses: actions/checkout@v3
with:
repository: madler/zlib
path: zlib
ref: ${{ env.zlib_ver }}
- name: Build and Install zlib
run: |
cmake -DCMAKE_BUILD_TYPE=Release -DBUILD_SHARED_LIBS=Off -DCMAKE_INSTALL_PREFIX="${DIST_PATH}" &&
make -j2 && make install
working-directory: zlib
# Build and install libxml2
- name: Checkout libxml2
uses: actions/checkout@v3
with:
repository: GNOME/libxml2
path: libxml2
ref: ${{ env.libxml2_ver }}
- name: Build and Install libxml2
run: |
./autogen.sh --prefix="${DIST_PATH}" ${LIBXML2_CONFIGURE_FLAGS} &&
make -j2 && make install-strip
working-directory: libxml2
# Clean-up
- name: Clean-up
run: |
rm -rf "${DIST_PATH}/bin" "${DIST_PATH}/share"
find "${DIST_PATH}/lib/" -iname '*.so*' -delete
rm -f "${DIST_PATH}/lib/libxml2.la" "${DIST_PATH}/lib/xml2Conf.sh"
# Build and install libTMX
- name: Checkout libTMX
uses: actions/checkout@v3
with:
path: tmx
- name: Build and Install libTMX
run: |
cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX="${DIST_PATH}" -DCMAKE_PREFIX_PATH="${DIST_PATH}" &&
make -j2 && make install
working-directory: tmx
# Upload
- name: Upload artifact
uses: actions/upload-artifact@v3
with:
name: ${{ env.ARTIFACT_NAME }}
path: ${{ env.DIST_PATH }}
html5:
name: HTML5 Build
runs-on: ubuntu-latest
steps:
- name: Create distribution folder
run: |
ARTIFACT_NAME=${GITHUB_REF:10}-html5
DIST_PATH=${GITHUB_WORKSPACE}/${ARTIFACT_NAME}
echo "ARTIFACT_NAME=${ARTIFACT_NAME}" >> $GITHUB_ENV
echo "DIST_PATH=${DIST_PATH}" >> $GITHUB_ENV
mkdir "${DIST_PATH}"
# Build and install emscripten
- name: Checkout emsdk
uses: actions/checkout@v3
with:
repository: emscripten-core/emsdk
path: emsdk
- name: Install emscripten
run: |
./emsdk install latest &&
./emsdk activate latest
working-directory: emsdk
# Libraries are compiled with flag -flto to generate LLVM bytecode (to later benefit from LTO)
# See: https://emscripten.org/docs/optimizing/Optimizing-Code.html#lto
# Build and install libxml2
- name: Checkout libxml2
uses: actions/checkout@v3
with:
repository: GNOME/libxml2
path: libxml2
ref: ${{ env.libxml2_ver }}
- name: Build and Install libxml2
run: |
. ${GITHUB_WORKSPACE}/emsdk/emsdk_env.sh
emconfigure ./autogen.sh --prefix="${DIST_PATH}" ${LIBXML2_CONFIGURE_FLAGS} &&
emmake make -j2 CFLAGS='-flto' && make install
working-directory: libxml2
# Clean-up
- name: Clean-up
run: rm -rf "${DIST_PATH}/bin" "${DIST_PATH}/share" "${DIST_PATH}/lib/libxml2.la" "${DIST_PATH}/lib/xml2Conf.sh"
# Build and install libTMX
- name: Checkout libTMX
uses: actions/checkout@v3
with:
path: tmx
- name: Build and Install libTMX
run: |
. ${GITHUB_WORKSPACE}/emsdk/emsdk_env.sh
emcmake cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX="${DIST_PATH}" \
-DCMAKE_PREFIX_PATH="${DIST_PATH}" -DCMAKE_FIND_ROOT_PATH="${DIST_PATH}" \
-DCMAKE_C_FLAGS='-flto' &&
make -j2 && make install
working-directory: tmx
# Upload
- name: Upload artifact
uses: actions/upload-artifact@v3
with:
name: ${{ env.ARTIFACT_NAME }}
path: ${{ env.DIST_PATH }}
windows:
name: Windows Build
runs-on: windows-2019
steps:
- name: Create distribution folder
run: |
$ARTIFACT_NAME=$($Env:GITHUB_REF).substring(10) + "-win"
echo "ARTIFACT_NAME=$ARTIFACT_NAME" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
$DIST_PATH="$($Env:GITHUB_WORKSPACE)\$ARTIFACT_NAME"
echo "DIST_PATH=$DIST_PATH" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
mkdir "$DIST_PATH"
# Build and install zlib
- name: Checkout zlib
uses: actions/checkout@v3
with:
repository: madler/zlib
path: zlib
ref: ${{ env.zlib_ver }}
- name: Build and Install zlib
run: |
cmake -G "MinGW Makefiles" -DCMAKE_BUILD_TYPE=Release -DBUILD_SHARED_LIBS=Off `
-DCMAKE_INSTALL_PREFIX="$($Env:DIST_PATH)" &&
mingw32-make -j2 && mingw32-make install
working-directory: zlib
# Build and install libxml2
- name: Checkout libxml2
uses: actions/checkout@v3
with:
repository: GNOME/libxml2
path: libxml2
ref: ${{ env.libxml2_ver }}
- name: Build and Install libxml2
run: |
cscript configure.js prefix="$($Env:DIST_PATH)" compiler=mingw `
c14n=no catalog=no debug=no docb=no ftp=no http=no html=no xpath=no xptr=no xinclude=no iconv=no `
icu=no iso8859x=no zlib=no lzma=no xml_debug=no mem_debug=no run_debug=no schemas=no schematron=no `
regexps=no modules=no pattern=no valid=no sax1=no legacy=no python=no walker=no `
push=yes tree=yes output=yes writer=yes reader=yes &&
mingw32-make -f Makefile.mingw -j2 &&
Move-Item -Path bin.mingw\libxml2.a -Destination "$($Env:DIST_PATH)\lib" &&
New-Item -Path "$($Env:DIST_PATH)\include" -Name "libxml2" -ItemType "directory" &&
New-Item -Path "$($Env:DIST_PATH)\include\libxml2" -Name "libxml" -ItemType "directory" &&
Move-Item -Path "..\include\libxml\*.h" -Destination "$($Env:DIST_PATH)\include\libxml2\libxml"
working-directory: libxml2/win32
# Clean-up
- name: Clean-up
run: |
Remove-Item -Path "$($Env:DIST_PATH)/share" -Recurse
Remove-Item -Path "$($Env:DIST_PATH)/bin" -Recurse
Remove-Item -Path "$($Env:DIST_PATH)/lib/libzlib.dll.a"
# Build and install libTMX
- name: Checkout libTMX
uses: actions/checkout@v3
with:
path: tmx
- name: Build and Install libTMX
run: |
cmake -G "MinGW Makefiles" -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX="$($Env:DIST_PATH)" `
-DCMAKE_PREFIX_PATH="$($Env:DIST_PATH)" &&
mingw32-make -j2 && mingw32-make install
working-directory: tmx
# Upload
- name: Upload artifact
uses: actions/upload-artifact@v3
with:
name: ${{ env.ARTIFACT_NAME }}
path: ${{ env.DIST_PATH }}