-
Notifications
You must be signed in to change notification settings - Fork 682
Expand file tree
/
Copy path.gitlab-ci.yml
More file actions
264 lines (254 loc) · 12.3 KB
/
.gitlab-ci.yml
File metadata and controls
264 lines (254 loc) · 12.3 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
stages:
- init-builders
- build
- sign
- deploy
- publish
init-builders:
stage: init-builders
except:
- tags
tags:
- gitlab
script:
- send-ci-sqs linux
- send-ci-sqs windows
linux:
stage: build
artifacts:
expire_in: 2 weeks
paths:
- build/*.AppImage
- build/*.torrent
- build/install-x64/share/*.env
- build/install-x64/share/*.log
- build/build-server.log
script:
- "curl -O -J -L --header PRIVATE-TOKEN:$ACCESS_TOKEN http://gitlab.openshot.org/OpenShot/libopenshot/-/jobs/artifacts/$CI_COMMIT_REF_NAME/download?job=linux-builder"
- if [ ! -f artifacts.zip ]; then
- "curl -O -J -L --header PRIVATE-TOKEN:$ACCESS_TOKEN http://gitlab.openshot.org/OpenShot/libopenshot/-/jobs/artifacts/develop/download?job=linux-builder"
- fi
- unzip artifacts.zip
- cp -r "$CI_PROJECT_DIR/build/install-x64/python/." "$CI_PROJECT_DIR"
- export LD_LIBRARY_PATH=$CI_PROJECT_DIR/build/install-x64/lib:$LD_LIBRARY_PATH
- export QT_QPA_PLATFORM=offscreen
- python3 -m unittest discover -s src/tests -t src/tests --quiet
- VERSION=$(python3 src/launch.py -V)
- echo -e "CI_PROJECT_NAME:$CI_PROJECT_NAME\nCI_COMMIT_REF_NAME:$CI_COMMIT_REF_NAME\nCI_COMMIT_SHA:$CI_COMMIT_SHA\nCI_JOB_ID:$CI_JOB_ID\nCI_PIPELINE_ID:$CI_PIPELINE_ID\nVERSION:$VERSION" > "build/install-x64/share/$CI_PROJECT_NAME.env"
- git log $(git describe --tags --abbrev=0 @^)..@ --oneline --pretty=format:"- %C(auto,yellow)%h%C(auto,magenta)% %C(auto,blue)%>(12,trunc)%ad %C(auto,green)%<(25,trunc)%aN%C(auto,reset)%s%C(auto,red)% gD% D" --date=short > "build/install-x64/share/$CI_PROJECT_NAME.log"
- cd doc; make html SPHINXOPTS="-D ga4_measurement_id=G-W2VHM9Y8QH"; cd ..;
- python3 -u freeze.py build --git-branch=$CI_COMMIT_REF_NAME
- for dir in "build/*/"; do /bin/sh ./installer/mangle-hw-libs.sh $(realpath "${dir}"); done
- python3 -u installer/build_server.py "$SLACK_TOKEN" "$GITHUB_USER" "$GITHUB_PASS" "False" "$CI_COMMIT_REF_NAME" "$MAC_PASSWORD"
when: always
except:
- tags
tags:
- linux-focal
mac:
stage: build
artifacts:
expire_in: 2 weeks
paths:
- build/*.dmg
- build/*.torrent
- build/install-x64/share/*.env
- build/install-x64/share/*.log
- build/build-server.log
script:
- "curl -O -J -L --header PRIVATE-TOKEN:$ACCESS_TOKEN http://gitlab.openshot.org/OpenShot/libopenshot/-/jobs/artifacts/$CI_COMMIT_REF_NAME/download?job=mac-builder"
- if [ ! -f artifacts.zip ]; then
- "curl -O -J -L --header PRIVATE-TOKEN:$ACCESS_TOKEN http://gitlab.openshot.org/OpenShot/libopenshot/-/jobs/artifacts/develop/download?job=mac-builder"
- fi
- unzip artifacts.zip
- echo "Update extracted dependencies using install_name_tool (for Mac only)"
- libraries=$( find ./build/install-x64 -type f \( -name *.dylib -or -name *.so \) | sed 's/\.\/*//' )
- for f in $libraries; do
- echo "file f = $f"
- dependencies=$(oTool -L $f | grep libopenshot | sed 's/ .*//' | xargs)
- for d in $dependencies; do
- echo "dependency d = $d"
- dname="$(basename $d)"
- echo "dependency fullpath = $CI_PROJECT_DIR/build/install-x64/lib/$dname"
- install_name_tool -change "$d" "$CI_PROJECT_DIR/build/install-x64/lib/$dname" "$f"
- done
- done
- cp -r "$CI_PROJECT_DIR/build/install-x64/python/." "$CI_PROJECT_DIR"
- export LD_LIBRARY_PATH=$CI_PROJECT_DIR/build/install-x64/lib:$LD_LIBRARY_PATH
- export DYLD_LIBRARY_PATH=$CI_PROJECT_DIR/build/install-x64/lib:DYLD_LIBRARY_PATH
- VERSION=$(python3 src/launch.py -V)
- echo -e "CI_PROJECT_NAME:$CI_PROJECT_NAME\nCI_COMMIT_REF_NAME:$CI_COMMIT_REF_NAME\nCI_COMMIT_SHA:$CI_COMMIT_SHA\nCI_JOB_ID:$CI_JOB_ID\nCI_PIPELINE_ID:$CI_PIPELINE_ID\nVERSION:$VERSION" > "build/install-x64/share/$CI_PROJECT_NAME.env"
- git log $(git describe --tags --abbrev=0 @^)..@ --oneline --pretty=format:"- %C(auto,yellow)%h%C(auto,magenta)% %C(auto,blue)%>(12,trunc)%ad %C(auto,green)%<(25,trunc)%aN%C(auto,reset)%s%C(auto,red)% gD% D" --date=short > "build/install-x64/share/$CI_PROJECT_NAME.log"
- python3 -u freeze.py bdist_mac --git-branch=$CI_COMMIT_REF_NAME --iconfile=installer/openshot.icns --custom-info-plist=installer/Info.plist --bundle-name="OpenShot Video Editor"
- python3 -u installer/build_server.py "$SLACK_TOKEN" "$GITHUB_USER" "$GITHUB_PASS" "False" "$CI_COMMIT_REF_NAME" "$MAC_PASSWORD"
when: always
except:
- tags
tags:
- mac
win-x64:
stage: build
artifacts:
expire_in: 2 weeks
paths:
- build\*.exe
- build\*.torrent
- build\install-x64\share\*.env
- build\install-x64\share\*.log
- build\build-server.log
script:
- $PSVersionTable
- $PSDefaultParameterValues['Out-File:Encoding'] = 'utf8'
- try { Invoke-WebRequest -Uri "http://gitlab.openshot.org/OpenShot/libopenshot/-/jobs/artifacts/$CI_COMMIT_REF_NAME/download?job=windows-builder-x64" -Headers @{"PRIVATE-TOKEN"="$ACCESS_TOKEN"} -OutFile "artifacts.zip" } catch { $_.Exception.Response.StatusCode.Value__ }
- if (-not (Test-Path "artifacts.zip")) { Invoke-WebRequest -Uri "http://gitlab.openshot.org/OpenShot/libopenshot/-/jobs/artifacts/develop/download?job=windows-builder-x64" -Headers @{"PRIVATE-TOKEN"="$ACCESS_TOKEN"} -OutFile "artifacts.zip" }
- Expand-Archive -Path artifacts.zip -DestinationPath .
- Copy-Item "$CI_PROJECT_DIR/build/install-x64/python/*" -Destination "$CI_PROJECT_DIR"
- $env:MSYSTEM = "MINGW64"
- $originalPath = $env:Path
- $NewPath = "$CI_PROJECT_DIR\build\install-x64\bin;$CI_PROJECT_DIR\build\install-x64\python;C:\msys64\mingw64\bin;"
- $env:Path = $NewPath + $env:Path
- $PY_ABI = (python3 -c "import sysconfig; print(sysconfig.get_config_var('py_version_short'))")
- $NewPath = $NewPath + "C:\msys64\mingw64\lib\python" + $PY_ABI + "\;C:\msys64\mingw64\lib\python" + $PY_ABI + "\site-packages\;C:\msys64\mingw64\lib\python" + $PY_ABI + "\site-packages\PyQt5;";
- $env:Path = $NewPath + $originalPath
- $env:PYTHONPATH = "$CI_PROJECT_DIR\build\install-x64\python;C:\msys64\mingw64\lib\python" + $PY_ABI + "\site-packages\PyQt5;"
- $VERSION=(python3 src/launch.py -V)
- New-Item -path "build/install-x64/share/" -Name "$CI_PROJECT_NAME.env" -Value "CI_PROJECT_NAME:$CI_PROJECT_NAME`nCI_COMMIT_REF_NAME:$CI_COMMIT_REF_NAME`nCI_COMMIT_SHA:$CI_COMMIT_SHA`nCI_JOB_ID:$CI_JOB_ID`nCI_PIPELINE_ID:$env:CI_PIPELINE_ID`nVERSION:$VERSION" -ItemType file -force
- $PREV_GIT_LABEL=(git describe --tags --abbrev=0 '@^')
- git log "$PREV_GIT_LABEL..@" --oneline --pretty=format:"- %C(auto,yellow)%h%C(auto,magenta)% %C(auto,blue)%>(12,trunc)%ad %C(auto,green)%<(25,trunc)%aN%C(auto,reset)%s%C(auto,red)% gD% D" --date=short > "build/install-x64/share/$CI_PROJECT_NAME.log"
- python3 -u freeze.py build --git-branch=$CI_COMMIT_REF_NAME
- $EXE_PATH = "$CI_PROJECT_DIR\build\exe.mingw-" + $PY_ABI + "\openshot-qt.exe"
- $manifestPath = "installer/windows.manifest"
- (Get-Content $manifestPath) -creplace "ARCHITECTURE", "amd64" | Set-Content $manifestPath
- mt.exe -manifest installer/windows.manifest -validate_manifest
- mt.exe -manifest installer/windows.manifest -outputresource:$EXE_PATH;1
- python3 -u installer/build_server.py "$SLACK_TOKEN" "$GITHUB_USER" "$GITHUB_PASS" "False" "$CI_COMMIT_REF_NAME" "$MAC_PASSWORD" "build-only"
when: always
except:
- tags
tags:
- windows
win-x86:
stage: build
artifacts:
expire_in: 2 weeks
paths:
- build\*.exe
- build\*.torrent
- build\install-x86\share\*.env
- build\install-x86\share\*.log
- build\build-server.log
script:
- $PSVersionTable
- $PSDefaultParameterValues['Out-File:Encoding'] = 'utf8'
- try { Invoke-WebRequest -Uri "http://gitlab.openshot.org/OpenShot/libopenshot/-/jobs/artifacts/$CI_COMMIT_REF_NAME/download?job=windows-builder-x86" -Headers @{"PRIVATE-TOKEN"="$ACCESS_TOKEN"} -OutFile "artifacts.zip" } catch { $_.Exception.Response.StatusCode.Value__ }
- if (-not (Test-Path "artifacts.zip")) { Invoke-WebRequest -Uri "http://gitlab.openshot.org/OpenShot/libopenshot/-/jobs/artifacts/develop/download?job=windows-builder-x86" -Headers @{"PRIVATE-TOKEN"="$ACCESS_TOKEN"} -OutFile "artifacts.zip" }
- Expand-Archive -Path artifacts.zip -DestinationPath .
- Copy-Item "$CI_PROJECT_DIR/build/install-x86/python/*" -Destination "$CI_PROJECT_DIR"
- $env:MSYSTEM = "MINGW32"
- $originalPath = $env:Path
- $NewPath = "$CI_PROJECT_DIR\build\install-x86\bin;$CI_PROJECT_DIR\build\install-x86\python;C:\msys64\mingw32\bin;"
- $env:Path = $NewPath + $env:Path
- $PY_ABI = (python3 -c "import sysconfig; print(sysconfig.get_config_var('py_version_short'))")
- $NewPath = $NewPath + "C:\msys64\mingw32\lib\python" + $PY_ABI + "\;C:\msys64\mingw32\lib\python" + $PY_ABI + "\site-packages\;C:\msys64\mingw32\lib\python " + $PY_ABI+ "\site-packages\PyQt5;";
- $env:Path = $NewPath + $originalPath
- $env:PYTHONPATH = "$CI_PROJECT_DIR\build\install-x86\python;C:\msys64\mingw32\lib\python" + $PY_ABI + "\site-packages\PyQt5;"
- $VERSION=(python3 src/launch.py -V)
- New-Item -path "build/install-x86/share/" -Name "$CI_PROJECT_NAME.env" -Value "CI_PROJECT_NAME:$CI_PROJECT_NAME`nCI_COMMIT_REF_NAME:$CI_COMMIT_REF_NAME`nCI_COMMIT_SHA:$CI_COMMIT_SHA`nCI_JOB_ID:$CI_JOB_ID`nCI_PIPELINE_ID:$env:CI_PIPELINE_ID`nVERSION:$VERSION" -ItemType file -force
- $PREV_GIT_LABEL=(git describe --tags --abbrev=0 '@^')
- git log "$PREV_GIT_LABEL..@" --oneline --pretty=format:"- %C(auto,yellow)%h%C(auto,magenta)% %C(auto,blue)%>(12,trunc)%ad %C(auto,green)%<(25,trunc)%aN%C(auto,reset)%s%C(auto,red)% gD% D" --date=short > "build/install-x86/share/$CI_PROJECT_NAME.log"
- python3 -u freeze.py build --git-branch=$CI_COMMIT_REF_NAME
- $EXE_PATH = "$CI_PROJECT_DIR\build\exe.mingw-" + $PY_ABI + "\openshot-qt.exe"
- editbin /LARGEADDRESSAWARE "$EXE_PATH"
- $manifestPath = "installer/windows.manifest"
- (Get-Content $manifestPath) -creplace "ARCHITECTURE", "x86" | Set-Content $manifestPath
- mt.exe -manifest installer/windows.manifest -validate_manifest
- mt.exe -manifest installer/windows.manifest -outputresource:$EXE_PATH;1
- python3 -u installer/build_server.py "$SLACK_TOKEN" "$GITHUB_USER" "$GITHUB_PASS" "True" "$CI_COMMIT_REF_NAME" "$MAC_PASSWORD" "build-only"
when: always
except:
- tags
tags:
- windows
win-sign-x64:
stage: sign
artifacts:
expire_in: 2 weeks
paths:
- build\*-x86_64.exe
- build\build-server.log
dependencies:
- win-x64
script:
- $PSVersionTable
- $env:Path = $env:Path + ";C:\msys64\usr\local\bin;C:\msys64\usr\bin"
- if (-not (Get-ChildItem -Path "build\*-x86_64.exe" -ErrorAction SilentlyContinue)) { throw "No x64 Windows installer found in build\\*-x86_64.exe" }
- py -3 -u installer/build_server.py "$SLACK_TOKEN" "$GITHUB_USER" "$GITHUB_PASS" "False" "$CI_COMMIT_REF_NAME" "$MAC_PASSWORD" "sign-upload-only"
when: on_success
except:
- tags
tags:
- code-sign
win-sign-x86:
stage: sign
artifacts:
expire_in: 2 weeks
paths:
- build\*-x86.exe
- build\build-server.log
dependencies:
- win-x86
script:
- $PSVersionTable
- $env:Path = $env:Path + ";C:\msys64\usr\local\bin;C:\msys64\usr\bin"
- if (-not (Get-ChildItem -Path "build\*-x86.exe" -ErrorAction SilentlyContinue)) { throw "No x86 Windows installer found in build\\*-x86.exe" }
- py -3 -u installer/build_server.py "$SLACK_TOKEN" "$GITHUB_USER" "$GITHUB_PASS" "True" "$CI_COMMIT_REF_NAME" "$MAC_PASSWORD" "sign-upload-only"
when: on_success
except:
- tags
tags:
- code-sign
re-init-builders:
stage: deploy
when: manual
except:
- tags
only:
- /^release.*$/
tags:
- gitlab
script:
- send-ci-sqs linux
- send-ci-sqs windows
deployer:
stage: deploy
artifacts:
expire_in: 2 weeks
paths:
- build/*.log
- build/*.sha256sum
- build/*.verify
- build/*.torrent
script:
- python3 -u installer/deploy.py "$SLACK_TOKEN" "$GITHUB_USER" "$GITHUB_PASS" "False"
when: manual
except:
- tags
only:
- /^release.*$/
tags:
- linux
publisher:
stage: publish
artifacts:
expire_in: 2 weeks
paths:
- build/*.log
script:
- python3 -u installer/deploy.py "$SLACK_TOKEN" "$GITHUB_USER" "$GITHUB_PASS" "True"
when: manual
except:
- tags
only:
- /^release.*$/
tags:
- linux