forked from mbasaglia/glaxnimate
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path.gitlab-ci.yml
More file actions
462 lines (434 loc) · 14.2 KB
/
.gitlab-ci.yml
File metadata and controls
462 lines (434 loc) · 14.2 KB
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
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
# https://gitlab.com/mattia.basaglia/glaxnimate/-/ci/lint
default:
before_script:
- apt-get update -qq
- apt-get install -y cmake qtbase5-dev libpython3-dev python3-pip zlib1g-dev qttools5-dev-tools qttools5-dev libpotrace-dev libavformat-dev libswscale-dev libavcodec-dev libavutil-dev libarchive-dev libqt5svg5-dev
variables:
DEBIAN_FRONTEND: noninteractive
GIT_SUBMODULE_STRATEGY: recursive
.shared_windows_runners:
tags:
- shared-windows
- windows
- windows-1809
pages:
image: ubuntu:latest
stage: deploy
script:
- apt-get install -y doxygen graphviz g++ python3-distutils git
- mkdir -p build
- cd build
- cmake ..
- make doxygen
- make docs_depends_install
- make docs
after_script:
- mv build/docs/site public
- mv build/coverage public/coverage
- mv build/doxygen/html public/doxygen
artifacts:
paths:
- public
when: always
only:
- master
needs: ["linux:test"]
linux:test:
image: ubuntu:latest
stage: build
script:
- pip3 install gcovr
- mkdir build
- cd build
- cmake .. -DCMAKE_CXX_FLAGS=--coverage
- make tests_coverage
artifacts:
paths:
- build/coverage
when: always
linux:build:
image: ubuntu:latest
stage: build
script:
- mkdir build
- cd build
- cmake .. -DCMAKE_CXX_FLAGS="-Werror -pedantic"
- make VERBOSE=1
when: always
linux:deb:
image: ubuntu:latest
stage: build
script:
- mkdir build
- cd build
- cmake .. -DCPACK_DEBIAN_FILE_NAME=glaxnimate.deb -DVERSION_SUFFIX="deb-$CI_COMMIT_SHORT_SHA"
- make
- make translations
- cpack -G DEB
- sha1sum glaxnimate.deb >checksum.txt
artifacts:
paths:
- build/glaxnimate.deb
- build/checksum.txt
- build/CMakeCache.txt
when: always
linux:aur:
image: archlinux:latest
stage: deploy
dependencies:
needs: []
# Build on release instead of tag so we can trigger it again
only:
- release
before_script:
- pacman -Syu --noconfirm
- pacman -S --noconfirm git base-devel fakeroot vim openssh namcap xorg-xauth cmake qt5-base python zlib hicolor-icon-theme potrace ffmpeg qt5-tools sudo qt5-svg qt5-imageformats libffi glib2
script:
# Setup
- useradd -m foo
- chmod 600 "$AUR_SSH_KEY"
- mkdir -p build
- cd build
- cmake ..
# Settings
- PROJECT_VERSION="$(../deploy/get_version.sh CMakeCache.txt)"
- git config --global user.name "Glaxnimate CI"
- git config --global user.email "glaxnimate-ci@mattbas.org"
# Update glaxnimate
- PACK_NAME=glaxnimate
- GIT_SSH_COMMAND="ssh -o StrictHostKeyChecking=no -i $AUR_SSH_KEY" git clone ssh://aur@aur.archlinux.org/$PACK_NAME.git
- cd $PACK_NAME
- echo "Setting version $PROJECT_VERSION"
- sed -i -e "s/pkgver=.*/pkgver=$PROJECT_VERSION/" PKGBUILD
- cat PKGBUILD
- chown -R foo .
- sudo -u foo makepkg -f
- namcap PKGBUILD
- sudo -u foo makepkg --printsrcinfo > .SRCINFO
- if ! git diff-index --quiet HEAD -- ; then git commit -am "Update to version $PROJECT_VERSION" ; GIT_SSH_COMMAND="ssh -o StrictHostKeyChecking=no -i $AUR_SSH_KEY" git push ; fi
linux:aur_build:
image: archlinux:latest
stage: build
before_script:
- pacman -Syu --noconfirm
- pacman -S --noconfirm git base-devel fakeroot vim openssh namcap xorg-xauth cmake qt5-base python zlib hicolor-icon-theme potrace ffmpeg qt5-tools sudo qt5-svg qt5-imageformats libffi glib2
script:
# Setup
- useradd -m foo
- mkdir -p build
- cd build
- cmake ..
# Build
- PACK_NAME=glaxnimate-git
- git clone https://aur.archlinux.org/$PACK_NAME.git
- cd $PACK_NAME
- chown -R foo .
- sudo -u foo makepkg -f
- namcap PKGBUILD
linux:appimage:
image: ubuntu:16.04
stage: build
before_script:
- apt-get update -qq
- apt-get install -y libpython3-dev python3-pip software-properties-common desktop-file-utils wget zlib1g-dev libpotrace-dev zip libarchive-dev
- add-apt-repository ppa:beineri/opt-qt-5.15.0-xenial -y
- add-apt-repository ppa:ubuntu-toolchain-r/test -y
- apt update -qq
- apt-get install -y qt515base qt515tools qt515translations libgl1-mesa-dev g++-9 qt515svg
- pip3 install cmake
- echo libav from source
- apt-get install -y git build-essential nasm pkg-config
- git clone https://github.com/FFmpeg/FFmpeg.git
- cd FFmpeg/
- ./configure --disable-static --enable-shared
- make
- make install
- cd ..
script:
- mkdir build
- cd build
- cmake .. -DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_CXX_COMPILER=/usr/bin/g++-9 -DCMAKE_PREFIX_PATH=/opt/qt515/lib/cmake/Qt5LinguistTools/ -DVERSION_SUFFIX="appimage-$CI_COMMIT_SHORT_SHA"
- make
- make translations
- make install DESTDIR=AppDir >/dev/null
- mkdir AppDir/usr/lib
- cp -r /usr/lib/python3.* AppDir/usr/lib
- cp ../deploy/app_run.sh AppDir/AppRun
- chmod a+x AppDir/AppRun
- cp AppDir/usr/share/glaxnimate/glaxnimate/glaxnimate.desktop AppDir
- cp AppDir/usr/share/glaxnimate/glaxnimate/images/glaxnimate.png AppDir
- wget https://github.com/probonopd/linuxdeployqt/releases/download/continuous/linuxdeployqt-continuous-x86_64.AppImage
- chmod a+x linuxdeployqt-continuous-x86_64.AppImage
- ./linuxdeployqt-continuous-x86_64.AppImage --appimage-extract
- ls -l /usr/local/lib/
- ldd AppDir/usr/bin/glaxnimate
- LD_LIBRARY_PATH="/usr/local/lib/:$LD_LIBRARY_PATH" ldd AppDir/usr/bin/glaxnimate
- PATH="/opt/qt515/bin/:$PATH" LD_LIBRARY_PATH="/usr/local/lib/:$LD_LIBRARY_PATH" VERSION=dev ./squashfs-root/AppRun AppDir/glaxnimate.desktop -extra-plugins=iconengines,platformthemes,imageformats -bundle-non-qt-libs -appimage
- mv glaxnimate-dev-x86_64.AppImage glaxnimate-x86_64.AppImage
- sha1sum glaxnimate-x86_64.AppImage >checksum.txt
artifacts:
paths:
- build/glaxnimate-x86_64.AppImage
- build/checksum.txt
when: always
tarball:
stage: build
before_script:
script:
- rm -rf .git
- cd ..
- tar -caf /tmp/glaxnimate-src.tar.gz "$(basename "$CI_PROJECT_DIR")"
- cd "$CI_PROJECT_DIR"
- mv /tmp/glaxnimate-src.tar.gz .
- sha1sum glaxnimate-src.tar.gz >checksum.txt
artifacts:
paths:
- glaxnimate-src.tar.gz
- checksum.txt
release:
stage: deploy
before_script:
- apt-get update -qq
- apt-get install -y python3-pip rsync
- pip3 install requests
script:
- ./deploy/make_release.py
# Copy release files into the release tag directory
- mkdir artifacts
- cd artifacts
- chmod 600 "$AUR_SSH_KEY"
- rsync -a mbasaglia@frs.sourceforge.net:/home/frs/project/glaxnimate/release . -e "ssh -o StrictHostKeyChecking=no -i $AUR_SSH_KEY"
- mv release $CI_COMMIT_TAG
- rsync -a $CI_COMMIT_TAG mbasaglia@frs.sourceforge.net:/home/frs/project/glaxnimate/ -e "ssh -o StrictHostKeyChecking=no -i $AUR_SSH_KEY"
only:
- tags
when: manual
artifacts:
paths:
- artifacts/release/MacOs/glaxnimate.dmg
- artifacts/release/MacOs/checksum.txt
- artifacts/release/Win/glaxnimate-x86_64.zip
- artifacts/release/Win/checksum.txt
release:check:
stage: deploy
when: manual
dependencies:
needs: []
only:
- tags
- master
before_script:
- apt-get update -qq
- apt-get install -y python3-pip
- pip3 install requests
script:
- ./deploy/release_check.py
release:check_deb:
image: ubuntu:latest
stage: deploy
only:
- tags
- master
- release
dependencies:
- release:check
needs:
- release:check
before_script:
- apt-get update -qq
- apt-get install -y python3-pip xvfb
- pip3 install requests
script:
- ./deploy/release_check.py --package "Deb Package" --action check_hash
- ./deploy/release_check.py --package "Deb Package" --action download
- apt install -y ./glaxnimate.deb
- Xvfb :0 -screen 0 1024x768x16 &
- export DISPLAY=:0
- ./deploy/check_package_version.sh glaxnimate
release:check_appimage:
image: ubuntu:latest
stage: deploy
only:
- tags
- master
- release
dependencies:
- release:check
needs:
- release:check
before_script:
- apt-get update -qq
- apt-get install -y libfuse2 libgl1-mesa-dev libglib2.0-0 python3-pip xvfb libqt5widgets5
- pip3 install requests
script:
- ./deploy/release_check.py --package "Linux Appimage" --action check_hash
- ./deploy/release_check.py --package "Linux Appimage" --action download
- chmod a+x glaxnimate-x86_64.AppImage
- ./glaxnimate-x86_64.AppImage --appimage-extract
- Xvfb :0 -screen 0 1024x768x16 &
- export DISPLAY=:0
- ./deploy/check_package_version.sh ./squashfs-root/AppRun
release:check_pypi:
image: ubuntu:latest
stage: deploy
only:
- tags
- master
- release
dependencies:
- release:check
needs:
- release:check
before_script:
- apt-get update -qq
- apt-get install -y python3-pip curl libqt5widgets5 libqt5xml5 potrace ffmpeg libarchive13
script:
- PYPI_VERSION="`./deploy/pypi_version_latest.sh`"
- pip3 install glaxnimate=="$PYPI_VERSION"
- ./deploy/pypi_version_check.py "$PYPI_VERSION"
linux:snap_tag:
#image: snapcore/snapcraft:stable
image: mattbas/snapcraft:latest
stage: deploy
only:
- tags
dependencies:
needs: []
before_script:
- apt-get update -qq
- apt-get install -y python3-pip
- apt remove cmake
- pip3 install cmake
script:
- test -n "$SNAPCRAFT_LOGIN_FILE"
- test -f "$SNAPCRAFT_LOGIN_FILE"
- mkdir -p build
- cd build
- cmake .. -DSNAP_IS_SUCH_A_PAIN=ON -DVERSION_SUFFIX="" || true
- ls -lah .
- cd ..
- mkdir snap
- cp build/snapcraft.yaml snap
- snapcraft
- snapcraft login --with "$SNAPCRAFT_LOGIN_FILE"
- snapcraft upload --release=stable glaxnimate_*.snap |& tee snap_out || true
- grep -Eq "Revision [0-9]+ of 'glaxnimate' created." snap_out
linux:snap_beta:
#image: snapcore/snapcraft:stable
image: mattbas/snapcraft:latest
stage: deploy
only:
- master
- pre-release
dependencies:
needs: []
before_script:
- apt-get update -qq
- apt-get install -y python3-pip
- apt remove cmake
- pip3 install cmake
script:
- test -n "$SNAPCRAFT_LOGIN_FILE"
- test -f "$SNAPCRAFT_LOGIN_FILE"
- mkdir -p build
- cd build
- cmake .. -DSNAP_IS_SUCH_A_PAIN=ON -DVERSION_SUFFIX="snap-$CI_COMMIT_SHORT_SHA" || true
- ls -lah .
- cd ..
- mkdir snap
- cp build/snapcraft.yaml snap
- snapcraft
- snapcraft login --with "$SNAPCRAFT_LOGIN_FILE"
- snapcraft upload --release=beta glaxnimate_*.snap |& tee snap_out || true
- grep -Eq "Revision [0-9]+ of 'glaxnimate' created." snap_out
.pypi_build:
stage: build
script:
- python3 --version
- mkdir build
- cd build
- cmake ..
- make glaxnimate_python_depends_install
- make glaxnimate_python
artifacts:
paths:
- build/bin/python/build/lib/
linux:pypi_3.8:
image: ubuntu:20.04
extends: .pypi_build
only:
- master
- release
- tags
- pypi
linux:pypi_3.9:
image: ubuntu:21.04
extends: .pypi_build
only:
- master
- release
- tags
- pypi
linux:pypi_deploy:
image: ubuntu:latest
stage: deploy
needs: ["linux:pypi_3.8", "linux:pypi_3.9"]
dependencies:
- linux:pypi_3.8
- linux:pypi_3.9
script:
- python3 --version
- mkdir -p build
- cd build
- cmake .. -DVERSION_SUFFIX="git.`date +%Y%m%d%H%M%S`.$CI_COMMIT_BRANCH.$CI_COMMIT_SHORT_SHA"
- make glaxnimate_python_depends_install
- ls bin/python/build/lib
- make glaxnimate_python_wheel
- python3 -m twine upload bin/python/dist/*.whl --repository-url https://gitlab.com/api/v4/projects/19921167/packages/pypi --verbose
only:
- master
- release
- prerelease
environment:
name: Gitlab PyPI
linux:pypi_deploy_tag:
image: ubuntu:latest
stage: deploy
needs: ["linux:pypi_3.8", "linux:pypi_3.9"]
dependencies:
- linux:pypi_3.8
- linux:pypi_3.9
script:
- python3 --version
- mkdir -p build
- cd build
- if [ -z "$CI_COMMIT_TAG" ] ; then version="$(../deploy/pypi_version_tail.sh)"; else version=""; fi
- cmake .. -DVERSION_SUFFIX="$version"
- make glaxnimate_python_depends_install
- ls bin/python/build/lib
- make glaxnimate_python_wheel
- make glaxnimate_python_upload
environment:
name: PyPI
only:
- tags
- pypi
#windows:build:
#extends:
#- .shared_windows_runners
#stage: build
#before_script:
#- choco feature enable -n allowGlobalConfirmation
#- choco install msys2
#- refreshenv
#script:
#- mkdir build
#- cd build
#- $env:CHERE_INVOKING='yes' # Preserve the current working directory
#- $env:MSYSTEM='MINGW64' # Start a 64 bit Mingw environment
#- C:\tools\msys64\usr\bin\bash -lc "../deploy/win_build.sh 2>&1"
#artifacts:
#paths:
#- build/glaxnimate-x86_64.zip
#- build/checksum.txt
#timeout: 3 hours