-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
398 lines (339 loc) · 13.8 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
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.4.1
SENTRY_VERSION: 0.7.6
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.8.0
qt_version_major: 6
env:
TILED_VERSION: ${{ needs.version.outputs.version }}
QT_VERSION: ${{ matrix.qt_version }}
QTCREATOR_VERSION: 14.0.2
steps:
- name: Checkout repository
uses: actions/checkout@v4
- 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@v2
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 -DSENTRY_BACKEND=breakpad
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'
continue-on-error: ${{ needs.version.outputs.release == 'false' }}
env:
SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }}
run: |
curl -sL https://sentry.io/get-cli/ | bash
sentry-cli debug-files upload --include-sources src AppDir
- 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-${{ needs.version.outputs.version }}_Linux_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@v4
with:
name: Tiled-${{ needs.version.outputs.version }}_Linux_Qt-${{ matrix.qt_version_major }}_x86_64.AppImage
path: Tiled-${{ needs.version.outputs.version }}_Linux_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@v4
with:
fetch-depth: 0
- name: Set Tiled version
id: version
run: |
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@v4
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-latest
needs: version
strategy:
matrix:
include:
- qt_version: 5.12.12
version_suffix: "10.12-10.15"
architectures: x86_64
- qt_version: 6.8.0
version_suffix: "11+"
architectures: x86_64,arm64
env:
TILED_VERSION: ${{ needs.version.outputs.version }}
QT_VERSION: ${{ matrix.qt_version }}
QTCREATOR_VERSION: 14.0.2
steps:
- name: Checkout repository
uses: actions/checkout@v4
- 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 release 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-${{ needs.version.outputs.version }}_macOS-${{ matrix.version_suffix }}.zip
- name: Upload Tiled.app
uses: actions/upload-artifact@v4
with:
name: Tiled-${{ needs.version.outputs.version }}_macOS-${{ matrix.version_suffix }}.app
path: Tiled-${{ needs.version.outputs.version }}_macOS-${{ matrix.version_suffix }}.zip
windows:
name: Windows (${{ matrix.arch }}-bit, Qt ${{ matrix.qt_version_major }})
runs-on: windows-latest
needs: version
strategy:
matrix:
include:
- qt_version: 5.15.2
qt_version_major: 5
qt_toolchain: win32_mingw81
arch: 32
openssl_arch: x86
filename_suffix: 'Windows-7-8_x86'
mingw_version: 8.1.0
mingw_component: mingw
mingw_path: /c/Qt/Tools/mingw810_32/bin
- qt_version: 6.8.0
qt_version_major: 6
qt_toolchain: win64_mingw
arch: 64
openssl_arch: x64
filename_suffix: 'Windows-10+_x86_64'
mingw_version: 13.1.0
mingw_component: mingw1310
mingw_path: /c/Qt/Tools/mingw1310_64/bin
env:
TILED_VERSION: ${{ needs.version.outputs.version }}
MINGW_PATH: ${{ matrix.mingw_path }}
defaults:
run:
shell: bash
steps:
- name: Checkout repository
uses: actions/checkout@v4
- 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 }}
- 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 release 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 ./Tiled-${{ needs.version.outputs.version }}_${{ matrix.filename_suffix }}.msi
- name: Upload Tiled installer
uses: actions/upload-artifact@v4
with:
name: Tiled-${{ needs.version.outputs.version }}_${{ matrix.filename_suffix }}.msi
path: Tiled-${{ needs.version.outputs.version }}_*.msi
- name: Upload Tiled archive
uses: actions/upload-artifact@v4
with:
name: Tiled-${{ needs.version.outputs.version }}_${{ matrix.filename_suffix }}.zip
path: release/install-root/*
github:
name: Upload to GitHub releases
runs-on: ubuntu-latest
needs: [version, linux, macos, windows]
permissions:
contents: write
if: github.repository == 'mapeditor/tiled' && github.event_name == 'push' && needs.version.outputs.release == 'true'
steps:
- name: Download all artifacts
uses: actions/download-artifact@v4
- name: Create release
id: create_release
uses: softprops/action-gh-release@v2
with:
name: Tiled ${{ needs.version.outputs.version }}
draft: true
prerelease: false
files: |
Tiled-${{ needs.version.outputs.version }}_Windows-10+_x86_64.msi/*.msi
Tiled-${{ needs.version.outputs.version }}_Windows-7-8_x86.msi/*.msi
Tiled-${{ needs.version.outputs.version }}_Linux_Qt-5_x86_64.AppImage/*.AppImage
Tiled-${{ needs.version.outputs.version }}_Linux_Qt-6_x86_64.AppImage/*.AppImage
Tiled-${{ needs.version.outputs.version }}_macOS-10.12-10.15.app/*.zip
Tiled-${{ needs.version.outputs.version }}_macOS-11+.app/*.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@v4
- 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 }}