forked from adventuregamestudio/ags
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.cirrus.yml
349 lines (339 loc) · 14 KB
/
.cirrus.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
build_windows_task:
windows_container:
dockerfile: ci/windows/Dockerfile
os_version: 2019
env:
matrix:
- BUILD_CONFIG: Release
- BUILD_CONFIG: Debug
ALLEGRO_RELEASE: v4.4.3.1-agspatch-2
AGS_DIRECTX_LIB: C:\Lib\DirectX
AGS_LIBOGG_LIB: C:\Lib\Xiph
AGS_LIBTHEORA_LIB: C:\Lib\Xiph
AGS_LIBVORBIS_LIB: C:\Lib\Xiph
build_script: >
"C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\vcvarsall.bat" x86 &&
set "AGS_ALLEGRO_INCLUDE=C:\Source\Allegro\%ALLEGRO_RELEASE%\include;C:\Source\Allegro\%ALLEGRO_RELEASE%\build\VS2015\include" &&
set "AGS_ALLEGRO_LIB=C:\Lib\Allegro\%ALLEGRO_RELEASE%" &&
cd Solutions &&
msbuild Engine.sln /p:PlatformToolset=v140 /p:Configuration=%BUILD_CONFIG% /p:Platform=Win32 /maxcpucount /nologo
engine_pdb_artifacts:
path: Solutions/.build/*/*.pdb
delete_engine_pdb_script: >
cd Solutions/.build &&
del /s *.pdb *.map *.ilk *.iobj *.ipdb
binaries_artifacts:
path: Solutions/.build/*/*
build_linux_cmake_task:
only_if: $CIRRUS_RELEASE == ''
container:
dockerfile: ci/linux/Dockerfile
docker_arguments:
matrix:
- FROM_DEBIAN: debian:jessie
- FROM_DEBIAN: i386/debian:jessie
env:
matrix:
- BUILD_TYPE: release
- BUILD_TYPE: debug
build_script: |
arch=$(dpkg --print-architecture)
filename=${BUILD_TYPE}_$arch
mkdir build_$filename && cd build_$filename
cmake -DCMAKE_BUILD_TYPE=$BUILD_TYPE .. && make
binaries_artifacts:
path: build_*/ags
build_linux_debian_task:
container:
dockerfile: ci/linux/Dockerfile
docker_arguments:
matrix:
- FROM_DEBIAN: debian:jessie
- FROM_DEBIAN: i386/debian:jessie
env:
matrix:
- RPATH_PREFIX: lib
- RPATH_PREFIX:
build_script: |
arch=$(dpkg --print-architecture)
version=$(awk -F"[ \"]+" '{ if ($1=="#define" && $2=="ACI_VERSION_STR") { print $3; exit } }' Common/core/def_version.h)
sed -i -s "s/ags \(.*\)(.*)/ags \($version\)\1/" debian/changelog
if [ -n "$RPATH_PREFIX" ]; then
case $arch in
amd64)
bit=64
;;
i386)
bit=32
;;
*)
echo "Unknown architecture"
exit 1
;;
esac
DEB_BUILD_OPTIONS="rpath=$RPATH_PREFIX$bit" fakeroot debian/rules binary
sed -E "/^BI(NDMOUNT|T)=/d" debian/ags+libraries/hooks/B00_copy_libs.sh | BIT=$bit BINDMOUNT=$(pwd) sh
ar -p ../ags_${version}_$arch.deb data.tar.xz | unxz | tar -f - -xvC data --transform "s/.*ags/ags$bit/" ./usr/bin/ags
cd data && tar -cvzf ../data_$arch.tar.gz *
else
fakeroot debian/rules binary
mv ../ags_${version}_$arch.deb .
fi
debian_packages_artifacts:
path: ags_*.deb
data_files_artifacts:
path: data_*.tar.gz
build_linux_make_task:
only_if: $CIRRUS_RELEASE == ''
container:
dockerfile: ci/linux/Dockerfile
docker_arguments:
matrix:
- FROM_DEBIAN: debian:jessie
- FROM_DEBIAN: i386/debian:jessie
build_script: |
arch=$(dpkg --print-architecture)
make --directory=Engine
mkdir build_$arch && mv Engine/ags build_$arch/
binaries_artifacts:
path: build_*/ags
build_macos_task:
only_if: $CIRRUS_RELEASE == ''
osx_instance:
matrix:
- image: mojave-xcode-10.2 # newest minor release of previous version
- image: mojave-xcode # alias to latest xcode (11.x)
env:
matrix:
- BUILD_TYPE: debug
- BUILD_TYPE: release
CMAKE_VERSION: 3.14.5
install_cmake_script: |
url="https://github.com/Kitware/CMake/releases/download/v$CMAKE_VERSION/cmake-$CMAKE_VERSION-Darwin-x86_64.tar.gz"
echo "Downloading CMake from $url"
curl -fLSs "$url" | bsdtar -f - -xvzC /Applications --strip-components 1
build_script: |
xcode=$(xcodebuild -version | awk '{ print $2; exit }')
mkdir build_${xcode}_$BUILD_TYPE && cd build_${xcode}_$BUILD_TYPE
/Applications/CMake.app/Contents/bin/cmake -DCMAKE_BUILD_TYPE=$BUILD_TYPE .. && make
binaries_artifacts:
path: build_*/ags
build_android_task:
container:
dockerfile: ci/android/Dockerfile
docker_arguments:
FROM_DEBIAN: debian:buster
git_submodules_script: git submodule update --init --recursive
symlink_nativelibs_script: ln -s /opt/nativelibs Android/nativelibs
build_library_script: |
export PATH=$PATH:$(echo /opt/android-ndk-*)
cd Android/library && ndk-build
build_launcher_script: |
export ANDROID_HOME=/opt/android-sdk
export JAVA_HOME=$(echo /opt/jdk*)
export PATH=$PATH:$JAVA_HOME/bin
ant=$(echo /opt/apache-ant-*/bin/ant)
cd Android/launcher_list && $ant debug && $ant release
rename_apks_script: |
version=$(awk -F"[ \"]+" '{ if ($1=="#define" && $2=="ACI_VERSION_STR") { print $3; exit } }' Common/core/def_version.h)
cd Android/launcher_list/bin
for apk in $(find -maxdepth 1 -name "*.apk" -type f); do
mv -v $apk ${apk%%-*}-${version}-${apk#*-}
done
apks_artifacts:
path: Android/launcher_list/bin/AGS-*.apk
create_libs_archive_script: |
version=$(awk -F"[ \"]+" '{ if ($1=="#define" && $2=="ACI_VERSION_STR") { print $3; exit } }' Common/core/def_version.h)
bsdtar -f AGS-${version}-android-libs.zip -acv --strip-components 3 Android/library/libs
libs_artifacts:
path: AGS-*-android-libs.zip
build_editor_task:
windows_container:
dockerfile: ci/windows/Dockerfile
os_version: 2019
env:
matrix:
- BUILD_CONFIG: Release
- BUILD_CONFIG: Debug
ALLEGRO_RELEASE: v4.4.3.1-agspatch-2
AGS_DIRECTX_LIB: C:\Lib\DirectX
nuget_packages_cache:
folder: Solutions\packages
fingerprint_script: type Editor\AGS.Editor\packages.config
populate_script: nuget restore Solutions\AGS.Editor.Full.sln
build_script: >
"C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\vcvarsall.bat" x86 &&
set "AGS_ALLEGRO_INCLUDE=C:\Source\Allegro\%ALLEGRO_RELEASE%\include;C:\Source\Allegro\%ALLEGRO_RELEASE%\build\VS2015\include" &&
set "AGS_ALLEGRO_LIB=C:\Lib\Allegro\%ALLEGRO_RELEASE%" &&
set "UseEnv=true" &&
copy C:\Lib\irrKlang\*.dll Editor\References\ &&
cd Solutions &&
cmd /v:on /c "set "LIB=C:\Program Files (x86)\Windows Kits\8.0\Lib\Win8\um\x86;!LIB!" &&
msbuild AGS.Editor.Full.sln /p:PlatformToolset=v140 /p:Configuration=%BUILD_CONFIG% /p:Platform="Mixed Platforms" /maxcpucount /nologo"
ags_editor_pdb_artifacts:
path: Solutions/.build/*/*.pdb
ags_native_pdb_artifacts:
path: Editor/AGS.Native/*/AGS.Native.pdb
delete_editor_pdb_and_xml_script: >
cd Solutions/.build &&
del /s *.pdb *.xml
binaries_artifacts:
path: Solutions/.build/*/*
linux_packaging_task:
depends_on:
- build_linux_debian
container:
image: alpine:3.10
env:
ALLEGRO_RELEASE: v4.4.3.1-agspatch-2
install_packages_script: apk add --no-cache curl libarchive-tools
package_script: |
tmp=/tmp/bundle$$
mkdir -p $tmp/data
for archbit in i386-32 amd64-64; do
echo Downloading files for ${archbit%-*}
url="https://api.cirrus-ci.com/v1/artifact/build/$CIRRUS_BUILD_ID/build_linux_debian/data_files/data_${archbit%-*}.tar.gz"
curl -fLsS "$url" | bsdtar -f - -xvzC $tmp/data
echo Downloading Allegro $ALLEGRO_RELEASE ${archbit%-*}
mkdir $tmp/allegro_${ALLEGRO_RELEASE}_${archbit%-*}
url="https://github.com/adventuregamestudio/lib-allegro/releases/download/$ALLEGRO_RELEASE/lib-allegro_release_${archbit%-*}.tar.gz"
curl -fLsS "$url" | bsdtar -f - -xvzC $tmp/allegro_${ALLEGRO_RELEASE}_${archbit%-*} --strip-components 1 -s '|pkgconfig/.*||' lib
find $tmp/allegro_${ALLEGRO_RELEASE}_${archbit%-*} \( -name "alleg-*" -or -name "liballeg.so.?.?" \) \
-exec cp -v "{}" $tmp/data/lib${archbit#*-}/ \;
echo alleg-sdl2digi.so >> $tmp/data/lib${archbit#*-}/modules.lst
done
cp -v debian/copyright $tmp/data/licenses/ags-copyright
cp -v debian/ags+libraries/startgame $tmp/
awk 'BEGIN { RS="" } !/make_ags/ { if (NR>1) print RS; print }' debian/ags+libraries/README > $tmp/README
version=$(awk -F"[ \"]+" '{ if ($1=="#define" && $2=="ACI_VERSION_STR") { print $3; exit } }' Common/core/def_version.h)
bsdtar -f ags_${version}_linux.tar.gz -cvzC $tmp data startgame README
binaries_artifacts:
path: ags_*.tar.gz
editor_packaging_task:
depends_on:
- build_editor
- build_windows
- linux_packaging
windows_container:
dockerfile: ci/windows/Dockerfile
os_version: 2019
env:
TEMPLATES_REPOSITORY: adventuregamestudio/ags-templates
get_vcredist_script: >
mkdir Windows\Installer\Source\Redist &&
copy %SYSTEMDRIVE%\Redist\vc_redist.x86.exe Windows\Installer\Source\Redist\
get_editor_script: >
mkdir Windows\Installer\Source\Editor &&
curl -fLSs "https://api.cirrus-ci.com/v1/artifact/build/%CIRRUS_BUILD_ID%/build_editor/binaries.zip" |
tar -f - -xvzC Windows\Installer\Source\Editor --strip-components 3 Solutions/.build/Release
get_windows_engine_script: >
mkdir Windows\Installer\Source\Engine &&
curl -fLSso Windows\Installer\Source\Engine\acwin.exe
"https://api.cirrus-ci.com/v1/artifact/build/%CIRRUS_BUILD_ID%/build_windows/binaries/Solutions/.build/Release/acwin.exe"
get_manual_script: >
mkdir Windows\Installer\Source\Docs &&
cd Windows\Installer\Source\Docs &&
curl -fLOJ https://github.com/adventuregamestudio/ags-manual/releases/latest/download/ags-help.chm
get_templates_script: >
mkdir Windows\Installer\Source\Templates &&
curl -fLSs https://github.com/%TEMPLATES_REPOSITORY%/tarball/master |
tar -f - -xvzC Windows\Installer\Source\Templates --strip-components 2
get_linux_bundle_script: >
mkdir Windows\Installer\Source\Linux &&
call Script\setvar.cmd ACI_VERSION_STR &&
cmd /v:on /c "curl -fLSs "https://api.cirrus-ci.com/v1/artifact/build/%CIRRUS_BUILD_ID%/linux_packaging/binaries/ags_!ACI_VERSION_STR!_linux.tar.gz" |
tar -f - -xvC Windows\Installer\Source\Linux --strip-components 1"
make_installer_script: >
powershell Windows\Installer\build.ps1 -IsccPath 'C:\Program Files (x86)\Inno Setup 6\ISCC.exe'
installer_artifacts:
path: Windows\Installer\Output\*.exe
make_archive_script: >
move Windows\Installer\Source\Docs\* Windows\Installer\Source\Editor\ &&
move Windows\Installer\Source\Engine\* Windows\Installer\Source\Editor\ &&
move Windows\Installer\Source\Licenses Windows\Installer\Source\Editor\ &&
move Windows\Installer\Source\Linux Windows\Installer\Source\Editor\ &&
move Windows\Installer\Source\Templates Windows\Installer\Source\Editor\ &&
move Windows\Installer\Source\URLs Windows\Installer\Source\Editor\ &&
for %%f in (Windows\Installer\Output\*.exe) do
tar -f %%~nf.zip -acv --strip-components 4 Windows\Installer\Source\Editor
archive_artifacts:
path: AGS-*.zip
pdb_packaging_task:
depends_on:
- build_editor
- build_windows
container:
image: alpine:3.10
install_packages_script: apk add --no-cache curl libarchive-tools
download_pdb_files_script: |
mkdir /tmp/pdb &&
for download in "build_windows/engine_pdb.zip" \
"build_editor/ags_editor_pdb.zip" \
"build_editor/ags_native_pdb.zip"
do
curl -fLSs "https://api.cirrus-ci.com/v1/artifact/build/$CIRRUS_BUILD_ID/$download" | bsdtar -f - -xvzC /tmp/pdb -s "!.*/Debug/.*!!p" -s "!.*/!!p"
done
make_pdb_archive_script: |
version=$(awk -F"[ \"]+" '{ if ($1=="#define" && $2=="ACI_VERSION_STR") { print $3; exit } }' Common/core/def_version.h)
bsdtar -f AGS-${version}-pdb.zip -acv --strip-components 3 /tmp/pdb
archive_artifacts:
path: AGS-*-pdb.zip
make_release_task:
depends_on:
- build_android
- build_linux_debian
- editor_packaging
- linux_packaging
- pdb_packaging
container:
image: alpine:3.10
env:
GITHUB_TOKEN: ENCRYPTED[f94b2c269006d530d3e6f5f2be0962ba3eeb0d5f43630ad8172b9ef9c405611e54ae5a2b6efc7c53db68176168f0c83d]
install_packages_script: apk add --no-cache curl git libarchive-tools outils-sha256
git_submodules_script: git submodule update --init --recursive
create_source_archives_script: |
version=$(awk -F"[ \"]+" '{ if ($1=="#define" && $2=="ACI_VERSION_STR") { print $3; exit } }' Common/core/def_version.h)
mkdir -p /tmp/github_release && \
for ext in tar.bz2 tar.gz tar.xz zip; do
echo Writing $ext archive...
bsdtar -f /tmp/github_release/ags_${version}_source.$ext \
-acs "!\./\(.*\)!ags_${version}_source/\1!" \
--exclude ".git*" \
--exclude .cirrus.yml \
.;
done
download_release_files_script: |
version=$(awk -F"[ \"]+" '{ if ($1=="#define" && $2=="ACI_VERSION_STR") { print $3; exit } }' Common/core/def_version.h)
baseurl="https://api.cirrus-ci.com/v1/artifact/build/$CIRRUS_BUILD_ID"
mkdir -p /tmp/github_release && \
cd /tmp/github_release && \
curl -fLSs "$baseurl/editor_packaging/installer.zip" | bsdtar -f - -xv --strip-components 3 && \
for download in "editor_packaging/archive/$(basename AGS-*.exe .exe).zip" \
"linux_packaging/binaries/ags_${version}_linux.tar.gz" \
"pdb_packaging/archive/AGS-${version}-pdb.zip" \
"build_linux_debian/debian_packages/ags_${version}_i386.deb" \
"build_linux_debian/debian_packages/ags_${version}_amd64.deb" \
"build_android/apks/Android/launcher_list/bin/AGS-${version}-debug.apk" \
"build_android/libs/AGS-${version}-android-libs.zip"
do
url="$baseurl/$download"
echo "Downloading $url"
curl -fLOJ "$url"
done
create_checksums_script: >
cd /tmp/github_release &&
sha256 -r * | sed -E "s/[[:blank:]]+/ /" | tee /tmp/checksums.sha256 &&
mv /tmp/checksums.sha256 .
upload_release_script: |
if [ -z "$CIRRUS_RELEASE" ]; then
echo "This is not a release."
exit 0
fi
for fpath in $(find /tmp/github_release -type f); do
echo "Uploading $fpath"
curl -X POST \
--data-binary @$fpath \
--header "Authorization: token $GITHUB_TOKEN" \
--header "Content-Type: application/octet-stream" \
"https://uploads.github.com/repos/$CIRRUS_REPO_FULL_NAME/releases/$CIRRUS_RELEASE/assets?name=${fpath##*/}"
done