-
-
Notifications
You must be signed in to change notification settings - Fork 111
371 lines (315 loc) · 13.4 KB
/
ci.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
name: CI
# for a description, see README.md in this folder
on:
schedule:
- cron: '30 1 * * MON'
workflow_dispatch:
push:
branches:
- develop
- test
pull_request:
permissions:
contents: write
env:
QT_VERSION: '5.15.2' # quotes required or YAML parser will interpret as float
jobs:
version:
runs-on: ubuntu-latest
outputs:
version_number: ${{ steps.create-version.outputs.version_number }}
# The version number is YYYY.MM.DD.hhmm to create simple, easy-to-read "rolling release" versioning
# for pull requests before merge keep a static version number
steps:
- name: create version number
id: create-version
run: |
if [ $GITHUB_EVENT_NAME = 'schedule' ] || [ $GITHUB_EVENT_NAME = 'workflow_dispatch' ] || [ $GITHUB_EVENT_NAME = 'push' ] ; then
echo "version_number=$(date +%Y.%-m.%-d.%-H%M)" >> $GITHUB_OUTPUT
else
echo "version_number=0.6.0.1" >> $GITHUB_OUTPUT
fi
linux:
name: 'Linux: Build AppImage'
runs-on: ubuntu-20.04 # build on the oldest supported LTS so that resulting binaries are compatible with older and newer Linux releases
needs: version
env:
VERSION_NUMBER: ${{ needs.version.outputs.version_number }}
steps:
- uses: actions/checkout@v4
- name: install appimage dependencies
run: |
sudo apt update && sudo apt install -y libfuse2
sudo wget -q https://github.com/linuxdeploy/linuxdeploy/releases/download/continuous/linuxdeploy-x86_64.AppImage -O /usr/local/bin/linuxdeploy-x86_64.AppImage
sudo chmod +x /usr/local/bin/linuxdeploy-x86_64.AppImage
sudo wget -q https://github.com/linuxdeploy/linuxdeploy-plugin-qt/releases/download/continuous/linuxdeploy-plugin-qt-x86_64.AppImage -O /usr/local/bin/linuxdeploy-plugin-qt-x86_64.AppImage
sudo chmod +x /usr/local/bin/linuxdeploy-plugin-qt-x86_64.AppImage
- uses: jurplel/install-qt-action@v3
with:
version: ${{ env.QT_VERSION }}
cache: true
- name: update version
run: |
./scripts/version.sh ${VERSION_NUMBER}
- name: build Seamly2D appimage
env:
OUTPUT: Seamly2D-x86_64.AppImage # linuxdeploy-x86_64.AppImage uses this env var as name for AppImage
run: |
qmake -config release CONFIG+=noTests
make -j$(nproc)
make INSTALL_ROOT=`pwd`/AppDir install
# install poppler-utils for pdftops, gstreamer1.0-plugins-base for QtMultimedia, libxkbcommon for Qt xcb
sudo apt update && sudo apt install -y poppler-utils gstreamer1.0-plugins-base libxkbcommon-x11-0
cp /usr/bin/pdftops AppDir/usr/bin
mkdir -p AppDir/usr/share/X11/xkb
cp -r /usr/share/X11/xkb/* AppDir/usr/share/X11/xkb
linuxdeploy-x86_64.AppImage --appdir AppDir --desktop-file=dist/seamly2d.desktop --plugin qt --output appimage
- uses: actions/upload-artifact@v4
with:
name: Seamly2D-x86_64.AppImage
path: Seamly2D-x86_64.AppImage
if-no-files-found: error
linux-test:
if: github.event_name == 'pull_request'
name: 'Linux: Run unit tests'
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v4
- uses: jurplel/install-qt-action@v3
with:
version: ${{ env.QT_VERSION }}
cache: true
- name: build Seamly2D & SeamlyMe for tests
run: |
qmake Seamly2D.pro
make -j$(nproc)
- name: install test dependencies
# xvfb use to test built application within a framebuffer
run: |
sudo apt update
sudo apt install -y xvfb libxkbcommon-x11-0
- name: run Seamly2D tests
run: |
xvfb-run -a make check
macos:
name: 'macOS: Build'
runs-on: macos-13
needs: version
env:
VERSION_NUMBER: ${{ needs.version.outputs.version_number }}
steps:
- uses: actions/checkout@v4
- name: xcode version
# Qt 5.15.2 currently fails with qglobal.h:45:12: fatal error: 'type_traits' file not found
# when using Xcode 15.1+, thus lock working version while we are on Qt5
run: |
sudo xcode-select -s /Applications/Xcode_14.2.app
- uses: jurplel/install-qt-action@v3
with:
version: ${{ env.QT_VERSION }}
cache: true
- name: update version
run: |
./scripts/version.sh ${VERSION_NUMBER}
- name: setup signing and notarization
env:
KEYCHAIN_FILE: ~/seamly2d.keychain
APPLE_SIGN_IDENTITY: ${{ secrets.apple_sign_identity }}
if: ${{ env.APPLE_SIGN_IDENTITY }}
run: |
security create-keychain -p ${{ secrets.apple_keychain_password }} $KEYCHAIN_FILE
security unlock-keychain -p ${{ secrets.apple_keychain_password }} $KEYCHAIN_FILE
security set-keychain-settings $KEYCHAIN_FILE
security list-keychains -d user -s $KEYCHAIN_FILE
echo '${{ secrets.apple_sign_certificate }}' | base64 -d -o ~/seamly2d.p12
security import ~/seamly2d.p12 -k $KEYCHAIN_FILE -T /usr/bin/codesign -P ${{ secrets.apple_sign_certificate_password }}
security set-key-partition-list -S apple-tool:,apple: -s -k ${{ secrets.apple_keychain_password }} $KEYCHAIN_FILE
echo "APPLE_SIGN_IDENTITY=${{ secrets.apple_sign_identity }}" >> $GITHUB_ENV
mkdir -p ~/private_keys/
echo '${{ secrets.apple_notarize_key_content }}' > ~/private_keys/AuthKey_${{ secrets.apple_notarize_key_id }}.p8
echo "APPLE_NOTARIZE_KEY=~/private_keys/AuthKey_${{ secrets.apple_notarize_key_id }}.p8" >> $GITHUB_ENV
echo "APPLE_NOTARIZE_KEY_ID=${{ secrets.apple_notarize_key_id }}" >> $GITHUB_ENV
echo "APPLE_NOTARIZE_ISSUER_ID=${{ secrets.apple_notarize_issuer_id }}" >> $GITHUB_ENV
- name: make Seamly2D for macos
env:
APPLE_SIGN_IDENTITY: ${{ secrets.apple_sign_identity }}
run: |
# see https://github.com/actions/runner-images/issues/7522
echo killing XProtect...; sudo pkill -9 XProtect >/dev/null || true;
# run signing part if secrets are available (main builds), otherwise (3rd party PRs etc) skip
if [ -n "$APPLE_SIGN_IDENTITY" ] ; then
qmake Seamly2D.pro -config release CONFIG+=noTests CONFIG+=macSign
else
qmake Seamly2D.pro -config release CONFIG+=noTests
fi
make -j$(sysctl -n hw.logicalcpu)
- uses: actions/upload-artifact@v4
with:
name: Seamly2D-macos.zip
path: out/Seamly2D-macos.zip
if-no-files-found: error
windows:
name: 'Windows 64-Bit: Build'
runs-on: windows-latest
needs: version
env:
VERSION_NUMBER: ${{ needs.version.outputs.version_number }}
steps:
- uses: actions/checkout@v4
- uses: ilammy/msvc-dev-cmd@v1
- uses: jurplel/install-qt-action@v3
with:
version: ${{ env.QT_VERSION }}
cache: true
- name: update version
shell: bash
run: |
./scripts/version.sh ${VERSION_NUMBER}
- name: make seamly2d.exe and seamlyme.exe
run: |
qmake.exe Seamly2D.pro -config release CONFIG+=noTests
nmake
- name: create seamly2d-installer.exe
# copy seamly2d and seamlyme directory trees prepared by windeployqt and create installer
# uses parameters in seamly2d-installer.nsi to create the installer exe
run: |
mkdir ..\windows-build
Copy-Item -Path 'src\app\seamly2d\bin\*' -Destination ..\windows-build -Recurse
Copy-Item -Path 'src\app\seamlyme\bin\*' -Destination ..\windows-build -Recurse -Force
Copy-Item -Path dist\seamly2d-installer.nsi -Destination ..\windows-build
cd ..\windows-build\
& 'C:\Program Files (x86)\NSIS\makensis.exe' seamly2d-installer.nsi
- name: setup signing
id: setup_signing
uses: timheuer/[email protected]
env:
PFX_BASE64: ${{ secrets.pfx_base64 }}
if: ${{ env.PFX_BASE64 }}
with:
encodedString: ${{ secrets.pfx_base64 }}
fileName: seamly2d.pfx
- name: sign installer
env:
PFX_BASE64: ${{ secrets.pfx_base64 }}
if: false # temporarily disable signing until #1104 is solved, then revert to ${{ env.PFX_BASE64 }}
run: |
cd ..\windows-build\
SignTool sign /fd SHA256 /f ${{ steps.setup_signing.outputs.filePath }} /p ${{ secrets.pfx_password }} /t http://timestamp.sectigo.com Seamly2D-installer.exe
- name: pack installer file into .zip
run: |
cd ..\windows-build\
C:\"Program Files"\7-Zip\7z.exe a Seamly2D-windows.zip Seamly2D-installer.exe
copy Seamly2D-windows.zip ..\Seamly2D\
- uses: actions/upload-artifact@v4
with:
name: Seamly2D-windows.zip
path: Seamly2D-windows.zip
if-no-files-found: error
win32:
name: 'Windows 32-Bit: Build'
runs-on: windows-latest
needs: version
env:
VERSION_NUMBER: ${{ needs.version.outputs.version_number }}
steps:
- uses: actions/checkout@v4
- uses: ilammy/msvc-dev-cmd@v1
with:
arch: amd64_x86
- uses: jurplel/install-qt-action@v3
with:
version: ${{ env.QT_VERSION }}
arch: win32_msvc2019
cache: true
- name: update version
shell: bash
run: |
./scripts/version.sh ${VERSION_NUMBER}
- name: make seamly2d.exe and seamlyme.exe
run: |
qmake.exe Seamly2D.pro -config release CONFIG+=noTests
nmake
- name: create seamly2d-installer.exe
# copy seamly2d and seamlyme directory trees prepared by windeployqt and create installer
# uses parameters in seamly2d-installer.nsi to create the installer exe
run: |
mkdir ..\windows-build
Copy-Item -Path 'src\app\seamly2d\bin\*' -Destination ..\windows-build -Recurse
Copy-Item -Path 'src\app\seamlyme\bin\*' -Destination ..\windows-build -Recurse -Force
Copy-Item -Path dist\seamly2d-installer.nsi -Destination ..\windows-build
cd ..\windows-build\
& 'C:\Program Files (x86)\NSIS\makensis.exe' seamly2d-installer.nsi
- name: setup signing
id: setup_signing
uses: timheuer/[email protected]
env:
PFX_BASE64: ${{ secrets.pfx_base64 }}
if: ${{ env.PFX_BASE64 }}
with:
encodedString: ${{ secrets.pfx_base64 }}
fileName: seamly2d.pfx
- name: sign installer
env:
PFX_BASE64: ${{ secrets.pfx_base64 }}
if: false # temporarily disable signing until #1104 is solved, then revert to ${{ env.PFX_BASE64 }}
run: |
cd ..\windows-build\
SignTool sign /fd SHA256 /f ${{ steps.setup_signing.outputs.filePath }} /p ${{ secrets.pfx_password }} /t http://timestamp.sectigo.com Seamly2D-installer.exe
- name: pack installer file into .zip
run: |
cd ..\windows-build\
C:\"Program Files"\7-Zip\7z.exe a Seamly2D-win32.zip Seamly2D-installer.exe
copy Seamly2D-win32.zip ..\Seamly2D\
- uses: actions/upload-artifact@v4
with:
name: Seamly2D-win32.zip
path: Seamly2D-win32.zip
if-no-files-found: error
publish:
if: github.event_name == 'schedule' || github.event_name == 'workflow_dispatch' || github.event_name == 'push'
runs-on: ubuntu-latest
needs: [version, windows, win32, linux, macos]
env:
VERSION_NUMBER: ${{ needs.version.outputs.version_number }}
steps:
- uses: actions/download-artifact@v4
with:
name: Seamly2D-x86_64.AppImage
- uses: actions/download-artifact@v4
with:
name: Seamly2D-macos.zip
- uses: actions/download-artifact@v4
with:
name: Seamly2D-windows.zip
- uses: actions/download-artifact@v4
with:
name: Seamly2D-win32.zip
- uses: softprops/action-gh-release@v2
with:
tag_name: v${{ env.VERSION_NUMBER }}
name: ${{ env.VERSION_NUMBER }}
generate_release_notes: true
fail_on_unmatched_files: true
# push event is triggered after pull request is merged, and in these cases mark as prerelease
# all other (schedule and manual) are not marked as prerelease
prerelease: ${{ github.event_name == 'push' }}
files: |
Seamly2D-x86_64.AppImage
Seamly2D-macos.zip
Seamly2D-windows.zip
Seamly2D-win32.zip
document:
# Deploy Doxygen documentation for scheduled releases (schedule) and manual releases (workflow_dispatch) and pre-releases (push)
if: github.event_name == 'schedule' || github.event_name == 'workflow_dispatch' || github.event_name == 'push'
runs-on: ubuntu-latest
steps:
- name: Doxygen GitHub Pages Deploy Action
uses: DenverCoder1/doxygen-github-pages-action@60e8d33d954eafb4d54710db8130fb0ad8f7d157
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
branch: gh-pages
# folder where docs are built, must match OUTPUT_DIRECTORY in Doxyfile + html
folder: docs/html
config_file: Doxyfile
# target_folder must match pages config in https://github.com/FashionFreedom/Seamly2D/settings/pages
target_folder: docs/