forked from mapeditor/tiled
-
Notifications
You must be signed in to change notification settings - Fork 0
439 lines (373 loc) · 15.1 KB
/
packages.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
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
name: Build Packages
on:
push:
paths-ignore:
- 'docs/**'
- '**.md'
- 'appveyor.yml'
- '.travis.yml'
pull_request:
paths-ignore:
- 'docs/**'
- '**.md'
- 'appveyor.yml'
- '.travis.yml'
env:
QBS_VERSION: 2.0.2
SENTRY_VERSION: 0.6.5
SENTRY_ORG: mapeditor
SENTRY_PROJECT: tiled
TILED_RELEASE: ${{ startsWith(github.ref, 'refs/tags/v') }}
TILED_SNAPSHOT: ${{ !startsWith(github.ref, 'refs/tags/v') }}
jobs:
version:
name: Determine Tiled version
runs-on: ubuntu-latest
outputs:
version: ${{ steps.get-version.outputs.version }}
release: ${{ steps.get-version.outputs.release }}
steps:
- name: Get version
id: get-version
run: |
if [[ "$TILED_RELEASE" == 'true' ]]; then echo "version=${GITHUB_REF:11}" >> $GITHUB_OUTPUT ; fi
if [[ "$TILED_RELEASE" != 'true' ]]; then echo "version=$(date "+%Y.%m.%d")" >> $GITHUB_OUTPUT ; fi
echo "release=${TILED_RELEASE}" >> $GITHUB_OUTPUT
linux:
name: Linux (AppImage, Qt ${{ matrix.qt_version_major }})
runs-on: ubuntu-20.04
needs: version
strategy:
matrix:
include:
- qt_version: 5.15.2
qt_version_major: 5
- qt_version: 6.5.3
qt_version_major: 6
env:
TILED_VERSION: ${{ needs.version.outputs.version }}
QT_VERSION: ${{ matrix.qt_version }}
QTCREATOR_VERSION: 10.0.2
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Install dependencies
run: |
sudo apt update
sudo apt install \
libcurl4-openssl-dev \
libgl1-mesa-dev \
libxcb-cursor0 \
libxcb-icccm4 \
libxcb-image0 \
libxcb-keysyms1 \
libxcb-randr0 \
libxcb-render-util0 \
libxcb-shape0 \
libxcb-xinerama0 \
libxkbcommon-x11-0 \
libzstd-dev
- name: Install Qt
run: |
./dist/install-qt.sh --version ${QT_VERSION} qtbase qtdeclarative qtsvg qtimageformats qttools qttranslations icu | tee -a $GITHUB_PATH
./dist/install-qt.sh --version ${QTCREATOR_VERSION} qtcreator | tee -a $GITHUB_PATH
- name: Setup ccache
uses: hendrikmuhs/ccache-action@v1
with:
max-size: 250M
- name: Setup CMake
uses: jwlawson/actions-setup-cmake@v1
with:
cmake-version: '3.19'
- name: Setup Qbs
run: |
qbs --version
qbs setup-toolchains --detect
qbs config defaultProfile x86_64-linux-gnu-gcc-10
- name: Build Sentry Native
run: |
curl -sLO https://github.com/getsentry/sentry-native/releases/download/${SENTRY_VERSION}/sentry-native.zip
mkdir sentry-native
pushd sentry-native
unzip -q ../sentry-native.zip
cmake -B build -DCMAKE_BUILD_TYPE=RelWithDebInfo
cmake --build build --parallel
sudo cmake --install build --prefix /usr --config RelWithDebInfo
popd
- name: Build Tiled
run: |
qbs install --install-root AppDir config:release qbs.installPrefix:/usr projects.Tiled.sentry:true qbs.debugInformation:true modules.cpp.separateDebugInformation:true modules.cpp.compilerWrapper:ccache
- name: Upload symbols and sources to Sentry
if: github.repository == 'mapeditor/tiled' && github.event_name == 'push'
env:
SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }}
run: |
curl -sL https://sentry.io/get-cli/ | bash
sentry-cli upload-dif --include-sources src .
- name: Build AppImage
run: |
cp LICENSE* COPYING *md AppDir/
wget --no-verbose "https://github.com/linuxdeploy/linuxdeploy/releases/download/continuous/linuxdeploy-x86_64.AppImage"
wget --no-verbose "https://github.com/linuxdeploy/linuxdeploy-plugin-qt/releases/download/continuous/linuxdeploy-plugin-qt-x86_64.AppImage"
chmod +x linuxdeploy*.AppImage
export EXTRA_QT_PLUGINS=svg
export LD_LIBRARY_PATH=/opt/Qt/${QT_VERSION}/gcc_64/lib:$PWD/AppDir/usr/lib
export OUTPUT=Tiled-Qt${{ matrix.qt_version_major }}-x86_64.AppImage
# Avoid shipping the debug information
find AppDir -name \*.debug -delete
./linuxdeploy-x86_64.AppImage --appdir AppDir --custom-apprun=dist/linux/AppRun --exclude-library "*libpython3*" --plugin qt
# We don't need the bearer plugins (needed for Qt 5 only)
rm -rfv AppDir/usr/plugins/bearer
./linuxdeploy-x86_64.AppImage --appdir AppDir --custom-apprun=dist/linux/AppRun --exclude-library "*libpython3*" --output appimage
- name: Upload Tiled.AppImage
uses: actions/upload-artifact@v3
with:
name: Tiled-Qt${{ matrix.qt_version_major }}-x86_64.AppImage
path: Tiled-Qt${{ matrix.qt_version_major }}-x86_64.AppImage
snap:
name: Linux (snap)
runs-on: ubuntu-latest
needs: version
env:
TILED_VERSION: ${{ needs.version.outputs.version }}
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Set Tiled version
id: version
run: |
sed -i 's/^version: .*/version: '"${TILED_VERSION}"'/g' snap/snapcraft.yaml
if [[ "$TILED_RELEASE" == 'true' ]]; then echo "snap_channel=candidate" >> $GITHUB_OUTPUT ; fi
if [[ "$TILED_RELEASE" != 'true' ]]; then echo "snap_channel=beta" >> $GITHUB_OUTPUT ; fi
- name: Build snap
id: build
uses: snapcore/action-build@v1
- name: Upload snap artifact
uses: actions/upload-artifact@v3
with:
name: tiled_amd64.snap
path: tiled_*_amd64.snap
- name: Release snap (beta channel)
uses: snapcore/action-publish@master
if: github.repository == 'mapeditor/tiled' && github.event_name == 'push' && (github.ref == 'refs/heads/snapshot' || needs.version.outputs.release == 'true')
env:
SNAPCRAFT_STORE_CREDENTIALS: ${{ secrets.SNAP_STORE_LOGIN }}
with:
snap: ${{ steps.build.outputs.snap }}
release: ${{ steps.version.outputs.snap_channel }}
macos:
name: macOS (${{ matrix.version_suffix }})
runs-on: macos-11
needs: version
strategy:
matrix:
include:
- qt_version: 5.12.12
version_suffix: "10.12-10.15"
architectures: x86_64
- qt_version: 6.5.3
version_suffix: "11+"
architectures: x86_64,arm64
env:
TILED_VERSION: ${{ needs.version.outputs.version }}
QT_VERSION: ${{ matrix.qt_version }}
QTCREATOR_VERSION: 10.0.2
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Install Qt
run: |
sudo ./dist/install-qt.sh --version ${QT_VERSION} qtbase qtdeclarative qtsvg qtimageformats qttools | tee -a $GITHUB_PATH
sudo ./dist/install-qt.sh --version ${QTCREATOR_VERSION} qtcreator | tee -a $GITHUB_PATH
- name: Setup Qbs
run: |
qbs setup-toolchains --detect
qbs config defaultProfile xcode
- name: Build Zstandard
run: |
git clone --depth 1 -b master https://github.com/facebook/zstd.git
pushd zstd/lib
CFLAGS="-arch arm64 -arch x86_64" make libzstd.a
popd
- name: Build Tiled
run: |
qbs install --install-root install config:release qbs.architectures:${{ matrix.architectures }} qbs.installPrefix:"" projects.Tiled.staticZstd:true
- name: Deploy Qt
run: |
macdeployqt install/Tiled.app -verbose=2
rm -f install/Tiled.app/Contents/PlugIns/tls/libqopensslbackend.dylib
pushd install
ruby ../dist/macos/fixup-install-names.rb
- name: Create Certificate File
id: certificateFile
if: github.repository == 'mapeditor/tiled' && github.event_name == 'push'
uses: timheuer/base64-to-file@v1
with:
fileName: 'certificate.p12'
encodedString: ${{ secrets.MACOS_CERTIFICATE }}
- name: Import Certificate
if: github.repository == 'mapeditor/tiled' && github.event_name == 'push'
run: |
security create-keychain -p ${{ secrets.KEYCHAIN_PWD }} mapeditor/tiled
security default-keychain -s mapeditor/tiled
security unlock-keychain -p ${{ secrets.KEYCHAIN_PWD }} mapeditor/tiled
security -q import ${{ steps.certificateFile.outputs.filePath }} -f pkcs12 -k mapeditor/tiled -P ${{ secrets.MACOS_CERTIFICATE_PWD }} -T /usr/bin/codesign -x
security set-key-partition-list -S 'apple-tool:,apple:' -s -k ${{ secrets.KEYCHAIN_PWD }} mapeditor/tiled
- name: Sign, Notarize & Staple
if: github.repository == 'mapeditor/tiled' && github.event_name == 'push'
run: |
codesign --deep --force --verify --verbose --sign Lindeijer --options runtime install/Tiled.app
ditto -c -k --sequesterRsrc --keepParent install/Tiled.app Tiled_for_notarization.zip
xcrun notarytool submit --apple-id ${{ secrets.NOTARIZATION_USERNAME }} --password ${{ secrets.NOTARIZATION_PASSWORD }} --team-id ${{ secrets.NOTARIZATION_TEAM }} --wait Tiled_for_notarization.zip
xcrun stapler staple install/Tiled.app
- name: Create Archive
run: |
ditto -c -k --sequesterRsrc --keepParent install/Tiled.app Tiled_macOS-${{ matrix.version_suffix }}.zip
- name: Upload Tiled.app
uses: actions/upload-artifact@v3
with:
name: Tiled_macOS-${{ matrix.version_suffix }}.app
path: Tiled_macOS-${{ matrix.version_suffix }}.zip
windows:
name: Windows (${{ matrix.arch }}-bit, Qt ${{ matrix.qt_version_major }})
runs-on: windows-2019
needs: version
strategy:
matrix:
include:
- qt_version: 5.15.2
qt_version_major: 5
qt_toolchain: win32_mingw81
arch: 32
openssl_arch: x86
mingw_version: 8.1.0
mingw_component: mingw
mingw_path: /c/Qt/Tools/mingw810_32/bin
- qt_version: 6.5.3
qt_version_major: 6
qt_toolchain: win64_mingw
arch: 64
openssl_arch: x64
mingw_version: 9.0.0
mingw_component: mingw90
mingw_path: /c/Qt/Tools/mingw1120_64/bin
env:
TILED_VERSION: ${{ needs.version.outputs.version }}
MINGW_PATH: ${{ matrix.mingw_path }}
OPENSSL_VERSION: 1.1.1
defaults:
run:
shell: bash
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Install Qt
run: |
echo "QT_PATH=$(./dist/install-qt.sh --version ${{ matrix.qt_version }} --toolchain ${{ matrix.qt_toolchain }} qtbase qtdeclarative qtsvg qtimageformats qttools qttranslations)" >> $GITHUB_ENV
./dist/install-qt.sh --version ${{ matrix.mingw_version }} --toolchain win${{ matrix.arch }}_mingw ${{ matrix.mingw_component }}
echo "OPENSSL_PATH=$(./dist/install-qt.sh --version ${OPENSSL_VERSION} openssl --arch ${{ matrix.openssl_arch }})" >> $GITHUB_ENV
- name: Install Qbs
run: |
choco install -y qbs --version ${QBS_VERSION}
- name: Setup Qbs
run: |
qbs setup-toolchains ${MINGW_PATH}/*-w64-mingw32-gcc.exe mingw
qbs setup-qt ${QT_PATH}/qmake.exe qt
qbs config defaultProfile qt
- name: Build Zstandard
run: |
export PATH="${MINGW_PATH}:$PATH"
git clone --depth 1 -b master https://github.com/facebook/zstd.git
pushd zstd/lib
CC=gcc mingw32-make -j2 libzstd.a
popd
- name: Build Tiled
run: |
export TILED_MSI_VERSION=1.4.${GITHUB_RUN_NUMBER}
qbs build config:release projects.Tiled.windowsInstaller:true projects.Tiled.staticZstd:true
mv release/installer*/Tiled-*.msi .
- name: Upload Tiled installer
uses: actions/upload-artifact@v3
with:
name: Tiled-win${{ matrix.arch }}.msi
path: Tiled-*.msi
- name: Upload Tiled archive
uses: actions/upload-artifact@v3
with:
name: Tiled-win${{ matrix.arch }}
path: release/install-root/*
github:
name: Upload to GitHub releases
runs-on: ubuntu-latest
needs: [version, linux, macos, windows]
if: github.repository == 'mapeditor/tiled' && github.event_name == 'push' && needs.version.outputs.release == 'true'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
steps:
- name: Create release
id: create_release
uses: actions/create-release@v1
with:
tag_name: ${{ github.ref }}
release_name: Tiled ${{ needs.version.outputs.version }}
draft: true
prerelease: false
- name: Download all artifacts
uses: actions/download-artifact@v3
- name: Upload Windows 64-bit installer
uses: actions/upload-release-asset@v1
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: Tiled-win64.msi/Tiled-${{ needs.version.outputs.version }}-win64.msi
asset_name: Tiled-${{ needs.version.outputs.version }}_Windows-10+_x86_64.msi
asset_content_type: application/x-msi
- name: Upload Windows 32-bit installer
uses: actions/upload-release-asset@v1
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: Tiled-win32.msi/Tiled-${{ needs.version.outputs.version }}-win32.msi
asset_name: Tiled-${{ needs.version.outputs.version }}_Windows-7-8_x86.msi
asset_content_type: application/x-msi
- name: Upload Linux AppImage (Qt5)
uses: actions/upload-release-asset@v1
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: Tiled-Qt5-x86_64.AppImage/Tiled-Qt5-x86_64.AppImage
asset_name: Tiled-${{ needs.version.outputs.version }}_Linux_Qt-5_x86_64.AppImage
asset_content_type: application/vnd.appimage
- name: Upload Linux AppImage (Qt6)
uses: actions/upload-release-asset@v1
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: Tiled-Qt6-x86_64.AppImage/Tiled-Qt6-x86_64.AppImage
asset_name: Tiled-${{ needs.version.outputs.version }}_Linux_Qt-6_x86_64.AppImage
asset_content_type: application/vnd.appimage
- name: Upload macOS app (10.12-10.15)
uses: actions/upload-release-asset@v1
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: Tiled_macOS-10.12-10.15.app/Tiled_macOS-10.12-10.15.zip
asset_name: Tiled-${{ needs.version.outputs.version }}_macOS-10.12-10.15.zip
asset_content_type: application/zip
- name: Upload macOS app (11+)
uses: actions/upload-release-asset@v1
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: Tiled_macOS-11+.app/Tiled_macOS-11+.zip
asset_name: Tiled-${{ needs.version.outputs.version }}_macOS-11+.zip
asset_content_type: application/zip
sentry:
name: Create Sentry release
runs-on: ubuntu-latest
needs: [version, linux, macos, windows]
if: github.repository == 'mapeditor/tiled' && github.event_name == 'push' && needs.version.outputs.release == 'true'
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Create Sentry release
uses: getsentry/action-release@v1
env:
SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }}
with:
environment: releases
version: tiled@${{ needs.version.outputs.version }}