Live video on the AT Protocol
1include: ".ci/dockerfile-hash.yaml"
2
3variables:
4 DOCKER_REPO: "public.ecr.aws/m4j3c0j7/streamplace"
5
6build-bunny:
7 stage: build
8 interruptible: true
9 image:
10 name: gcr.io/kaniko-project/executor:v1.14.0-debug
11 entrypoint: [""]
12 timeout: 2 hours
13 script:
14 - mkdir -p /kaniko/.docker
15 - cp "$DOCKER_AUTH_CONFIG" /kaniko/.docker/config.json
16 - /kaniko/executor
17 --context "${CI_PROJECT_DIR}/docker"
18 --dockerfile "${CI_PROJECT_DIR}/docker/bunny.Dockerfile"
19 --destination "$DOCKER_REPO:bunny"
20
21builder:
22 stage: build
23 interruptible: true
24 allow_failure: true
25 image:
26 name: gcr.io/kaniko-project/executor:v1.14.0-debug
27 entrypoint: [""]
28 variables:
29 FQ_IMAGE_NAME: "$DOCKER_REPO:builder-$DOCKERFILE_HASH"
30 TARGET: builder
31 timeout: 2 hours
32 script:
33 - mkdir -p /kaniko/.docker
34 - cp "$DOCKER_AUTH_CONFIG" /kaniko/.docker/config.json
35 - /kaniko/executor
36 --build-arg TARGETARCH=amd64
37 --build-arg DOCKERFILE_HASH=$DOCKERFILE_HASH
38 --cache=true
39 --context "${CI_PROJECT_DIR}"
40 --dockerfile "${CI_PROJECT_DIR}/docker/build.Dockerfile"
41 --destination "$FQ_IMAGE_NAME"
42 --target "$TARGET"
43
44builder-rebuild:
45 tags:
46 - tiny-job
47 stage: build
48 allow_failure: true
49 interruptible: true
50 image:
51 name: curlimages/curl:latest
52 entrypoint: [""]
53 needs:
54 - job: builder
55 timeout: 2 hours
56 script:
57 - echo "CI_PIPELINE_ID=$CI_PIPELINE_ID"
58 - echo "CI_PIPELINE_ID=$CI_PIPELINE_IID"
59 - echo "CI_PROJECT_ID=$CI_PROJECT_ID"
60 - >
61 curl
62 --data-raw '{"project_id": "'$CI_PROJECT_ID'", "pipeline_id": "'$CI_PIPELINE_ID'", "job_token": "'$CI_JOB_TOKEN'"}'
63 --fail-with-body
64 https://retry-gitlab.iameli.workers.dev/
65
66.build:
67 stage: build
68 interruptible: true
69 image: "$DOCKER_REPO:builder-$DOCKERFILE_HASH"
70 timeout: 2 hours
71 script:
72 - rm -rf /usr/x86_64-w64-mingw32/include/d3dcompiler.h /usr/share/mingw-w64/include/d3dcompiler.h /usr/lib/gcc/x86_64-w64-mingw32/10-posix/libssp.dll.a /usr/lib/gcc/x86_64-w64-mingw32/10-posix/libssp-0.dll /usr/lib/gcc/x86_64-w64-mingw32/10-win32/libssp-0.dll /usr/lib/gcc/x86_64-w64-mingw32/10-win32/libssp.dll.a
73 - git fetch --unshallow || echo 'already unshallow'
74 - bash -c "make version && make $TARGET && make desktop-$TARGET && make pkg-$TARGET && make ci-upload-node-$TARGET -j$(nproc)"
75 artifacts:
76 reports:
77 dotenv: .ci/build.env
78
79build-linux-amd64:
80 extends:
81 - .build
82 variables:
83 TARGET: linux-amd64
84
85build-linux-arm64:
86 extends:
87 - .build
88 variables:
89 TARGET: linux-arm64
90
91build-windows-amd64:
92 extends:
93 - .build
94 variables:
95 TARGET: windows-amd64
96
97build-darwin-arm64:
98 extends:
99 - .build
100 variables:
101 TARGET: darwin-arm64
102
103build-darwin-amd64:
104 extends:
105 - .build
106 variables:
107 TARGET: darwin-amd64
108
109leak-test-viewers:
110 stage: build
111 interruptible: true
112 needs:
113 - job: build-linux-amd64
114 artifacts: true
115 - job: build-bunny
116 image:
117 name: "$DOCKER_REPO:bunny"
118 variables:
119 SP_WIDE_OPEN: "true"
120 SP_NO_FIREHOSE: "true"
121 SP_WHIP_TEST: "--file=/bunny.mp4 --count=1 --viewers=50 --duration=5m"
122 KUBERNETES_MEMORY_REQUEST: "2Gi"
123 KUBERNETES_MEMORY_LIMIT: "2Gi"
124 GOGC: "20"
125 GOMEMLIMIT: "2GiB"
126 timeout: "10 minutes"
127 allow_failure: true
128 script:
129 - /bunny.sh
130
131leak-test-streamers:
132 stage: build
133 interruptible: true
134 needs:
135 - job: build-linux-amd64
136 artifacts: true
137 - job: build-bunny
138 image:
139 name: "$DOCKER_REPO:bunny"
140 variables:
141 SP_WIDE_OPEN: "true"
142 SP_NO_FIREHOSE: "true"
143 SP_WHIP_TEST: "--file=/bunny.mp4 --count=10 --duration=5m"
144 KUBERNETES_MEMORY_REQUEST: "2Gi"
145 KUBERNETES_MEMORY_LIMIT: "2Gi"
146 GOGC: "20"
147 GOMEMLIMIT: "2GiB"
148 timeout: "10 minutes"
149 allow_failure: true
150 script:
151 - /bunny.sh
152
153test:
154 stage: build
155 interruptible: true
156 image: "$DOCKER_REPO:builder-$DOCKERFILE_HASH"
157 timeout: 2 hours
158 variables:
159 STREAMPLACE_TEST_COUNT: "1"
160 script:
161 - git fetch --unshallow || echo 'already unshallow'
162 - make dev-setup && make dev && make dev-test && make ci-lexicons
163 artifacts:
164 when: always
165 paths:
166 - test.xml
167 reports:
168 junit: test.xml
169
170build-docker-mistserver:
171 stage: build
172 interruptible: true
173 needs:
174 - job: build-linux-amd64
175 artifacts: true
176 image:
177 name: gcr.io/kaniko-project/executor:v1.14.0-debug
178 entrypoint: [""]
179 timeout: 2 hours
180 script:
181 - mkdir -p /kaniko/.docker
182 - cp "$DOCKER_AUTH_CONFIG" /kaniko/.docker/config.json
183 - /kaniko/executor
184 --build-arg TARGETARCH=amd64
185 --build-arg STREAMPLACE_URL=$STREAMPLACE_URL_LINUX_AMD64
186 --context "${CI_PROJECT_DIR}"
187 --dockerfile "${CI_PROJECT_DIR}/docker/mistserver.Dockerfile"
188 --destination "$DOCKER_REPO:$STREAMPLACE_BRANCH-mistserver"
189 --destination "$DOCKER_REPO:$STREAMPLACE_VERSION-mistserver"
190
191build-docker-amd64:
192 stage: build
193 interruptible: true
194 needs:
195 - job: build-linux-amd64
196 artifacts: true
197 image:
198 name: gcr.io/kaniko-project/executor:v1.14.0-debug
199 entrypoint: [""]
200 timeout: 2 hours
201 script:
202 - mkdir -p /kaniko/.docker
203 - cp "$DOCKER_AUTH_CONFIG" /kaniko/.docker/config.json
204 - /kaniko/executor
205 --build-arg TARGETARCH=amd64
206 --build-arg STREAMPLACE_URL=$STREAMPLACE_URL_LINUX_AMD64
207 --context "${CI_PROJECT_DIR}"
208 --dockerfile "${CI_PROJECT_DIR}/docker/release.Dockerfile"
209 --destination "$DOCKER_REPO:$STREAMPLACE_BRANCH-amd64"
210 --destination "$DOCKER_REPO:$STREAMPLACE_VERSION-amd64"
211
212build-docker-arm64:
213 stage: build
214 interruptible: true
215 tags:
216 - linux
217 - arm64
218 needs:
219 - job: build-linux-arm64
220 artifacts: true
221 image:
222 name: gcr.io/kaniko-project/executor:v1.14.0-debug
223 entrypoint: [""]
224 timeout: 2 hours
225 script:
226 - mkdir -p /kaniko/.docker
227 - cp "$DOCKER_AUTH_CONFIG" /kaniko/.docker/config.json
228 - /kaniko/executor
229 --build-arg TARGETARCH=arm64
230 --build-arg STREAMPLACE_URL=$STREAMPLACE_URL_LINUX_ARM64
231 --context "${CI_PROJECT_DIR}"
232 --dockerfile "${CI_PROJECT_DIR}/docker/release.Dockerfile"
233 --destination "$DOCKER_REPO:$STREAMPLACE_BRANCH-arm64"
234 --destination "$DOCKER_REPO:$STREAMPLACE_VERSION-arm64"
235 --customPlatform=linux/arm64
236
237build-docker-manifest:
238 stage: build
239 interruptible: true
240 image:
241 name: curlimages/curl:latest
242 entrypoint: [""]
243 needs:
244 - job: build-docker-arm64
245 - job: build-docker-amd64
246 - job: build-linux-amd64 # just for the environment variables
247 artifacts: true
248 before_script:
249 - curl -s -L https://github.com/estesp/manifest-tool/releases/download/v2.1.7/binaries-manifest-tool-2.1.7.tar.gz | tar xvz
250 - mv manifest-tool-linux-amd64 ./manifest-tool
251 - chmod +x ./manifest-tool
252 timeout: 2 hours
253 script:
254 - ./manifest-tool --docker-cfg "$DOCKER_AUTH_CONFIG" push from-args
255 --platforms linux/amd64,linux/arm64
256 --template $DOCKER_REPO:$STREAMPLACE_VERSION-ARCH
257 --tags $STREAMPLACE_BRANCH
258 --target $DOCKER_REPO:$STREAMPLACE_VERSION
259
260.build-android:
261 stage: build
262 interruptible: true
263 image: "$DOCKER_REPO:builder-$DOCKERFILE_HASH"
264 timeout: 2 hours
265 script:
266 - git fetch --unshallow || echo 'already unshallow'
267 - make $TARGET -j$(nproc)
268
269build-android-debug:
270 extends:
271 - .build-android
272 variables:
273 TARGET: ci-android-debug
274
275build-android-release:
276 extends:
277 - .build-android
278 variables:
279 TARGET: ci-android-release
280
281.build-on-mac:
282 stage: build
283 interruptible: true
284 image: macos-sonoma-xcode-big
285 tags:
286 - tart-installed
287 variables:
288 STREAMPLACE_TEST_COUNT: "1"
289 NODE_OPTIONS: "--max_old_space_size=4096"
290 timeout: 2 hours
291 script:
292 # workaround for https://gitlab.com/gitlab-org/gitlab/-/issues/501457
293 # which is a workaround for ios builds failing due to /tmp vs /private/tmp weirdness
294 - cd ..
295 - mv streamplace /Users/admin/streamplace
296 - cd /Users/admin/streamplace
297 - git fetch --unshallow || echo 'already unshallow'
298 - brew install ninja go openssl@3 && go version
299 - export PATH="/opt/homebrew/opt/node@22/bin:$PATH"
300 - brew install node@22
301 - node --version
302 - npm install -g corepack@latest --force
303 - corepack enable
304 - sudo gem uninstall xcodeproj -x --ignore-dependencies
305 - sudo gem install xcodeproj -v 1.25.1
306 - curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs > rustup.sh && bash rustup.sh -y && rm rustup.sh
307 - export PATH="$PATH:$HOME/.cargo/bin"
308 - echo $PATH
309 - 'echo "which xcodeproj: $(which xcodeproj)"'
310 - 'echo "xcodeproj --version: $(xcodeproj --version)"'
311 - "$(which xcodeproj) --version"
312 - >
313 export GOTOOLCHAIN=go1.25.1
314 && python3 -m pip install virtualenv
315 && python3 -m virtualenv ~/venv
316 && source ~/venv/bin/activate
317 && python3 -m pip install meson
318 && ${=COMMAND}
319 # ^^ zsh-ism for running command with spaces
320
321build-ios:
322 extends:
323 - .build-on-mac
324 variables:
325 COMMAND: make ci-ios -j16
326
327build-desktop-darwin:
328 extends:
329 - .build-on-mac
330 needs:
331 - build-darwin-amd64
332 - build-darwin-arm64
333 variables:
334 COMMAND: make ci-desktop-darwin
335
336windows-selftest:
337 interruptible: true
338 stage: build
339 # for the moment...
340 tags:
341 - windows
342 timeout: 2 hours
343 needs:
344 - job: build-windows-amd64
345 artifacts: true
346 variables:
347 MSYSTEM: "MINGW32"
348 CHERE_INVOKING: "yes"
349 script:
350 - C:\msys64\usr\bin\bash -lc "bash -x ./util/windows-selftest.sh $STREAMPLACE_DESKTOP_URL_WINDOWS_AMD64"
351
352.release-template:
353 stage: build
354 interruptible: true
355 image: "$DOCKER_REPO:builder-$DOCKERFILE_HASH"
356 needs:
357 - build-darwin-amd64
358 - build-darwin-arm64
359 - build-android-debug
360 - build-android-release
361 - build-docker-amd64
362 - build-docker-arm64
363 - build-docker-manifest
364 - build-desktop-darwin
365 - build-ios
366 - test
367 rules:
368 - if: '$CI_COMMIT_TAG =~ /^v?\d+\.\d+\.\d+$/'
369 timeout: 2 hours
370
371npm-release:
372 extends:
373 - .release-template
374 script:
375 - make ci-npm-release
376
377release:
378 extends:
379 - .release-template
380 script:
381 - make ci-release
382
383deb-release:
384 extends:
385 - .release-template
386 script:
387 - make ci-deb-release
388
389homebrew-release:
390 extends:
391 - .release-template
392 script:
393 - make ci-homebrew
394
395.report-status:
396 tags:
397 - tiny-job
398 interruptible: true
399 image:
400 name: curlimages/curl
401 entrypoint: [""]
402 variables:
403 STATUS_PROJECT: streamplace/streamplace
404 STATUS_NAME: git.stream.place
405 script:
406 # For complete details on the GitHub API please see:
407 # https://developer.github.com/v3/repos/statuses
408 - >
409 set -eu && curl -L
410 --fail-with-body
411 --silent
412 -X POST
413 -H "Accept: application/vnd.github+json"
414 -H "Authorization: Bearer $GITHUB_TOKEN"
415 -H "X-GitHub-Api-Version: 2022-11-28"
416 https://api.github.com/repos/${STATUS_PROJECT}/statuses/${CI_COMMIT_SHA}
417 -d '{"state":"'${CI_JOB_NAME}'","target_url":"'${CI_PIPELINE_URL}'","description":"'${STATUS_NAME}'","context":"'${STATUS_NAME}'"}'
418 environment:
419 name: reporting-github
420 dependencies: []
421
422pending:
423 stage: .pre
424 extends:
425 - .report-status
426
427success:
428 stage: .post
429 extends:
430 - .report-status
431
432failure:
433 stage: .post
434 extends:
435 - .report-status
436 rules:
437 - when: on_failure