-
Notifications
You must be signed in to change notification settings - Fork 102
357 lines (299 loc) · 11.3 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
name: Build Packages
on:
push:
paths-ignore:
- 'doc/**'
- '**.md'
- 'appveyor.yml'
pull_request:
paths-ignore:
- 'docs/**'
- '**.md'
- 'appveyor.yml'
env:
QT_VERSION: 5.15.2
QTCREATOR_VERSION: 4.15.2
SENTRY_VERSION: 0.4.11
SLATE_RELEASE: ${{ startsWith(github.ref, 'refs/tags/v') }}
SLATE_SNAPSHOT: ${{ !startsWith(github.ref, 'refs/tags/v') }}
jobs:
version:
name: Determine Slate 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 [[ "$SLATE_RELEASE" == 'true' ]]; then echo "::set-output name=version::${GITHUB_REF:11}" ; fi
if [[ "$SLATE_RELEASE" != 'true' ]]; then echo "::set-output name=version::$(date "+%Y.%m.%d")" ; fi
echo "::set-output name=release::${SLATE_RELEASE}"
linux:
name: Linux
runs-on: ubuntu-18.04
needs: version
env:
SLATE_VERSION: ${{ needs.version.outputs.version }}
steps:
- name: Checkout repository
uses: actions/checkout@v2
with:
submodules: recursive
- name: Install dependencies
run: |
sudo apt update
sudo apt install libgl1-mesa-dev libxkbcommon-x11-0 libxcb-icccm4 libxcb-image0 libxcb-keysyms1 libxcb-render-util0 libxcb-xinerama0 libzstd-dev libcurl4-openssl-dev qbs
- name: Install Qt
run: |
# Workaround for https://github.com/actions/runner/issues/1212
set -o pipefail
./dist/install-qt.sh --version ${QT_VERSION} qtbase qtdeclarative qtimageformats qtgraphicaleffects qtquickcontrols2 qttools icu | tee -a $GITHUB_PATH
./dist/install-qt.sh --version ${QTCREATOR_VERSION} qtcreator | tee -a $GITHUB_PATH
- name: Setup CMake
uses: jwlawson/actions-setup-cmake@v1.8
with:
cmake-version: '3.19'
- name: Setup Qbs
run: |
qbs --version
qbs setup-toolchains --detect
qbs config defaultProfile x86_64-linux-gnu-gcc-9
echo "qbs profiles:"
qbs config --list profiles
echo "---"
- name: Build Slate
run: |
qbs install --install-root Slate config:release qbs.installPrefix:/usr qbs.debugInformation:true modules.cpp.separateDebugInformation:true
- name: Test Slate
run: |
DISPLAY=:1 qbs run -p test-app config:release -- -platform offscreen
- name: Deploy Slate
run: |
set -o pipefail
cp LICENSE.GPL3 *md Slate/
wget -c "https://github.com/probonopd/linuxdeployqt/releases/download/continuous/linuxdeployqt-continuous-x86_64.AppImage" -O linuxdeployqt
chmod a+x linuxdeployqt
./linuxdeployqt ./Slate/usr/share/applications/Slate.desktop -unsupported-allow-new-glibc -bundle-non-qt-libs -verbose=2
- name: Upload Slate
uses: actions/upload-artifact@v2
with:
name: Slate
path: Slate
# TODO: getting: "ERROR: Could not determine the path to the executable based on the desktop file" from this
# - name: Build AppImage
# run: |
# set -o pipefail
# cp LICENSE.GPL3 *md Slate/
# wget -c "https://github.com/probonopd/linuxdeployqt/releases/download/continuous/linuxdeployqt-continuous-x86_64.AppImage" -O linuxdeployqt
# chmod a+x linuxdeployqt
# ./linuxdeployqt ./Slate/usr/share/applications/Slate.desktop -bundle-non-qt-libs -verbose=2
# ./linuxdeployqt --appimage-extract
# export PATH=$(readlink -f ./squashfs-root/usr/bin/):$PATH
# ./squashfs-root/usr/bin/appimagetool Slate/
# find ./Slate -executable -type f -exec ldd {} \; | grep " => /usr" | cut -d " " -f 2-3 | sort | uniq
# - name: Upload Slate.AppImage
# uses: actions/upload-artifact@v2
# with:
# name: Slate-x86_64.AppImage
# path: Slate-x86_64.AppImage
macos:
name: macOS
runs-on: macos-latest
needs: version
env:
SLATE_VERSION: ${{ needs.version.outputs.version }}
steps:
- name: Checkout repository
uses: actions/checkout@v2
with:
submodules: recursive
- name: Install Qt
run: |
set -o pipefail
sudo ./dist/install-qt.sh --version ${QT_VERSION} qtbase qtdeclarative qtimageformats qtgraphicaleffects qtquickcontrols2 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 Slate
run: |
qbs install --install-root install config:release qbs.installPrefix:""
- name: Package
run: |
macdeployqt install/Slate.app -verbose=2
pushd install
ruby ../dist/macos/fixup-install-names.rb
ditto -c -k --sequesterRsrc --keepParent Slate.app ../Slate-macos.zip
popd
- name: Upload Slate.app
uses: actions/upload-artifact@v2
with:
name: Slate-macos.app
path: Slate-macos.zip
windows:
name: Windows (${{ matrix.arch }}-bit)
runs-on: windows-latest
needs: version
strategy:
matrix:
include:
- arch: 32
openssl_arch: x86
- arch: 64
openssl_arch: x64
env:
SLATE_VERSION: ${{ needs.version.outputs.version }}
QT_TOOLCHAIN: win${{ matrix.arch }}_mingw81
MINGW_VERSION: 8.1.0
MINGW_COMPONENT: win${{ matrix.arch }}_mingw810
OPENSSL_VERSION: 1.1.1
defaults:
run:
shell: bash
steps:
- name: Checkout repository
uses: actions/checkout@v2
with:
submodules: recursive
- name: Install Qt
run: |
echo "QT_PATH=$(./dist/install-qt.sh --version ${QT_VERSION} --toolchain ${QT_TOOLCHAIN} qtbase qtdeclarative qtimageformats qtgraphicaleffects qtquickcontrols2 qttools qttranslations)" >> $GITHUB_ENV
echo "MINGW_PATH=$(./dist/install-qt.sh --version ${MINGW_VERSION} ${MINGW_COMPONENT})" >> $GITHUB_ENV
echo "OPENSSL_PATH=$(./dist/install-qt.sh --version ${OPENSSL_VERSION} openssl --arch ${{ matrix.openssl_arch }})" >> $GITHUB_ENV
./dist/install-qt.sh --version ${QTCREATOR_VERSION} qtcreator >> $GITHUB_PATH
- 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 Slate
run: |
export TILED_MSI_VERSION=1.4.${GITHUB_RUN_NUMBER}
qbs build config:release
#TODO: need to do zip up the build dir and upload it below
#mv release/installer*/Slate-*.msi .
- name: Upload Slate installer
uses: actions/upload-artifact@v2
with:
name: Slate-win${{ matrix.arch }}.msi
path: Slate-*.msi
- name: Upload Slate archive
uses: actions/upload-artifact@v2
with:
name: Slate-win${{ matrix.arch }}
path: release/install-root/*
# itch:
# name: Upload to itch.io (${{ matrix.channel }})
# runs-on: ubuntu-latest
# needs: [version, linux, macos, windows]
# if: github.repository == 'mitchcurtis/slate' && github.event_name == 'push' && github.ref == 'refs/heads/snapshot'
# strategy:
# matrix:
# include:
# - channel: linux-64bit
# artifact: Slate-x86_64.AppImage
# prepare: chmod +x upload/Slate-x86_64.AppImage
# - channel: macos
# artifact: Slate-macos.app
# prepare: |
# pushd upload
# unzip Slate-macos.zip
# rm Slate-macos.zip
# popd
# - channel: windows-32bit
# artifact: Slate-win32
# - channel: windows-64bit
# artifact: Slate-win64
# steps:
# - name: Download artifact
# id: download
# uses: actions/download-artifact@v2
# with:
# name: ${{ matrix.artifact }}
# path: upload
# - name: Prepare artifact
# if: matrix.prepare
# run: ${{ matrix.prepare }}
# - name: Download Butler
# run: |
# curl -JOL https://broth.itch.ovh/butler/linux-amd64/LATEST/archive/default
# unzip butler-linux-amd64.zip
# - name: Push to itch.io
# env:
# BUTLER_API_KEY: ${{ secrets.BUTLER_CREDENTIALS }}
# SLATE_VERSION: ${{ needs.version.outputs.version }}
# run: |
# ITCH_CHANNEL=${{ matrix.channel }}
# if [[ "$SLATE_SNAPSHOT" == 'true' ]]; then ITCH_CHANNEL="${ITCH_CHANNEL}-snapshot" ; fi
# ./butler push --userversion=${SLATE_VERSION} upload mitchcurtis/slate:${ITCH_CHANNEL}
# github:
# name: Upload to GitHub releases
# runs-on: ubuntu-latest
# needs: [version, linux, macos, windows]
# if: github.repository == 'mitchcurtis/slate' && 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: Slate ${{ needs.version.outputs.version }}
# draft: true
# prerelease: false
#TODO: zips instead of msi
# - name: Download Windows 64-bit installer
# id: download-win64-installer
# uses: actions/download-artifact@v2
# with:
# name: Slate-win64.msi
# - name: Download Windows 32-bit installer
# id: download-win32-installer
# uses: actions/download-artifact@v2
# with:
# name: Slate-win32.msi
# - name: Download Linux AppImage
# id: download-appimage
# uses: actions/download-artifact@v2
# with:
# name: Slate-x86_64.AppImage
# - name: Download macOS app
# id: download-app
# uses: actions/download-artifact@v2
# with:
# name: Slate-macos.app
#TODO
# - name: Upload Windows 64-bit installer
# uses: actions/upload-release-asset@v1
# with:
# upload_url: ${{ steps.create_release.outputs.upload_url }}
# asset_path: Slate-${{ needs.version.outputs.version }}-win64.msi
# asset_name: Slate-${{ needs.version.outputs.version }}-win64.msi
# asset_content_type: applictaion/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: Slate-${{ needs.version.outputs.version }}-win32.msi
# asset_name: Slate-${{ needs.version.outputs.version }}-win32.msi
# asset_content_type: applictaion/x-msi
# - name: Upload Linux AppImage
# uses: actions/upload-release-asset@v1
# with:
# upload_url: ${{ steps.create_release.outputs.upload_url }}
# asset_path: Slate-x86_64.AppImage
# asset_name: Slate-${{ needs.version.outputs.version }}-x86_64.AppImage
# asset_content_type: application/vnd.appimage
# - name: Upload macOS app
# uses: actions/upload-release-asset@v1
# with:
# upload_url: ${{ steps.create_release.outputs.upload_url }}
# asset_path: Slate-macos.zip
# asset_name: Slate-${{ needs.version.outputs.version }}-macos.zip
# asset_content_type: application/zip
# - name: Checkout repository
# uses: actions/checkout@v2