Something went wrong. Try again.
This repository has no description
Something went wrong. Try again.
streamplace .gitlab-ci.yml
13 kB · 457 lines
YAML
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458include: ".ci/dockerfile-hash.yaml"
workflow: rules: # Tag pushes (releases) always build. - if: "$CI_COMMIT_TAG" # A release pushes the `next` branch and a `vX.Y.Z` tag at the same commit, # which would otherwise spawn two pipelines that build everything twice. The # tag pipeline above already covers it, so skip the redundant `next` build. # Release commits are titled like the tag (e.g. "v0.10.40"), so match on that. - if: '$CI_COMMIT_BRANCH == "next" && $CI_COMMIT_TITLE =~ /^v?\d+\.\d+\.\d+$/' when: never # Everything else (normal branch pushes) builds as usual. - when: always
variables: DOCKER_REPO: "public.ecr.aws/m4j3c0j7/streamplace"
build-bunny: stage: build interruptible: true image: name: gcr.io/kaniko-project/executor:v1.14.0-debug entrypoint: [""] timeout: 2 hours script: - mkdir -p /kaniko/.docker - cp "$DOCKER_AUTH_CONFIG" /kaniko/.docker/config.json - /kaniko/executor --context "${CI_PROJECT_DIR}/docker" --dockerfile "${CI_PROJECT_DIR}/docker/bunny.Dockerfile" --destination "$DOCKER_REPO:bunny"
builder: stage: build interruptible: true allow_failure: true image: name: gcr.io/kaniko-project/executor:v1.14.0-debug entrypoint: [""] variables: FQ_IMAGE_NAME: "$DOCKER_REPO:builder-$DOCKERFILE_HASH" TARGET: builder timeout: 2 hours script: - mkdir -p /kaniko/.docker - cp "$DOCKER_AUTH_CONFIG" /kaniko/.docker/config.json - /kaniko/executor --build-arg TARGETARCH=amd64 --build-arg DOCKERFILE_HASH=$DOCKERFILE_HASH --cache=true --context "${CI_PROJECT_DIR}" --dockerfile "${CI_PROJECT_DIR}/docker/build.Dockerfile" --destination "$FQ_IMAGE_NAME" --target "$TARGET"
builder-rebuild: tags: - tiny-job stage: build allow_failure: true interruptible: true image: name: curlimages/curl:latest entrypoint: [""] needs: - job: builder timeout: 2 hours script: - echo "CI_PIPELINE_ID=$CI_PIPELINE_ID" - echo "CI_PIPELINE_ID=$CI_PIPELINE_IID" - echo "CI_PROJECT_ID=$CI_PROJECT_ID" - > curl --data-raw '{"project_id": "'$CI_PROJECT_ID'", "pipeline_id": "'$CI_PIPELINE_ID'", "job_token": "'$CI_JOB_TOKEN'"}' --fail-with-body https://retry-gitlab.iameli.workers.dev/
.build: stage: build interruptible: true image: "$DOCKER_REPO:builder-$DOCKERFILE_HASH" timeout: 2 hours script: - 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 - git fetch --unshallow || echo 'already unshallow' - bash -c "make version && make $TARGET && make test-vod && make desktop-$TARGET && make pkg-$TARGET && make ci-upload-node-$TARGET -j$(nproc)" artifacts: reports: dotenv: .ci/build.env
build-linux-amd64: extends: - .build variables: TARGET: linux-amd64
build-linux-arm64: extends: - .build variables: TARGET: linux-arm64
build-windows-amd64: extends: - .build variables: TARGET: windows-amd64
build-darwin-arm64: extends: - .build variables: TARGET: darwin-arm64
build-darwin-amd64: extends: - .build variables: TARGET: darwin-amd64
leak-test-viewers: stage: build interruptible: true needs: - job: build-linux-amd64 artifacts: true - job: build-bunny image: name: "$DOCKER_REPO:bunny" variables: SP_WIDE_OPEN: "true" SP_NO_FIREHOSE: "true" SP_WHIP_TEST: "--file=/bunny.mp4 --count=1 --viewers=50 --duration=5m" KUBERNETES_MEMORY_REQUEST: "2Gi" KUBERNETES_MEMORY_LIMIT: "2Gi" GOGC: "20" GOMEMLIMIT: "2GiB" timeout: "10 minutes" allow_failure: true script: - /bunny.sh
leak-test-streamers: stage: build interruptible: true needs: - job: build-linux-amd64 artifacts: true - job: build-bunny image: name: "$DOCKER_REPO:bunny" variables: SP_WIDE_OPEN: "true" SP_NO_FIREHOSE: "true" SP_WHIP_TEST: "--file=/bunny.mp4 --count=10 --duration=5m" KUBERNETES_MEMORY_REQUEST: "2Gi" KUBERNETES_MEMORY_LIMIT: "2Gi" GOGC: "20" GOMEMLIMIT: "2GiB" timeout: "10 minutes" allow_failure: true script: - /bunny.sh
test: stage: build interruptible: true image: "$DOCKER_REPO:builder-$DOCKERFILE_HASH" timeout: 2 hours variables: STREAMPLACE_TEST_COUNT: "1" STREAMPLACE_TEST_POSTGRES_COMMAND: "install -d -o postgres -g postgres -m 2775 /var/run/postgresql && install -d -o postgres -g postgres -m 3775 /var/run/postgresql/14-main.pg_stat_tmp && sudo -u postgres /usr/lib/postgresql/14/bin/postgres -D /etc/postgresql/14/main/" script: - git fetch --unshallow || echo 'already unshallow' - make dev-setup && make dev && make dev-test && make ci-lexicons artifacts: when: always paths: - test.xml reports: junit: test.xml
build-docker-mistserver: stage: build interruptible: true needs: - job: build-linux-amd64 artifacts: true image: name: gcr.io/kaniko-project/executor:v1.14.0-debug entrypoint: [""] timeout: 2 hours script: - mkdir -p /kaniko/.docker - cp "$DOCKER_AUTH_CONFIG" /kaniko/.docker/config.json - /kaniko/executor --build-arg TARGETARCH=amd64 --build-arg STREAMPLACE_URL=$STREAMPLACE_URL_LINUX_AMD64 --context "${CI_PROJECT_DIR}" --dockerfile "${CI_PROJECT_DIR}/docker/mistserver.Dockerfile" --destination "$DOCKER_REPO:$STREAMPLACE_BRANCH-mistserver" --destination "$DOCKER_REPO:$STREAMPLACE_VERSION-mistserver"
build-docker-amd64: stage: build interruptible: true needs: - job: build-linux-amd64 artifacts: true image: name: gcr.io/kaniko-project/executor:v1.14.0-debug entrypoint: [""] timeout: 2 hours script: - mkdir -p /kaniko/.docker - cp "$DOCKER_AUTH_CONFIG" /kaniko/.docker/config.json - /kaniko/executor --build-arg TARGETARCH=amd64 --build-arg STREAMPLACE_URL=$STREAMPLACE_URL_LINUX_AMD64 --context "${CI_PROJECT_DIR}" --dockerfile "${CI_PROJECT_DIR}/docker/release.Dockerfile" --destination "$DOCKER_REPO:$STREAMPLACE_BRANCH-amd64" --destination "$DOCKER_REPO:$STREAMPLACE_VERSION-amd64"
build-docker-arm64: stage: build interruptible: true tags: - linux - arm64 needs: - job: build-linux-arm64 artifacts: true image: name: gcr.io/kaniko-project/executor:v1.14.0-debug entrypoint: [""] timeout: 2 hours script: - mkdir -p /kaniko/.docker - cp "$DOCKER_AUTH_CONFIG" /kaniko/.docker/config.json - /kaniko/executor --build-arg TARGETARCH=arm64 --build-arg STREAMPLACE_URL=$STREAMPLACE_URL_LINUX_ARM64 --context "${CI_PROJECT_DIR}" --dockerfile "${CI_PROJECT_DIR}/docker/release.Dockerfile" --destination "$DOCKER_REPO:$STREAMPLACE_BRANCH-arm64" --destination "$DOCKER_REPO:$STREAMPLACE_VERSION-arm64" --customPlatform=linux/arm64
build-docker-manifest: stage: build interruptible: true image: name: curlimages/curl:latest entrypoint: [""] needs: - job: build-docker-arm64 - job: build-docker-amd64 - job: build-linux-amd64 # just for the environment variables artifacts: true before_script: - curl -s -L https://github.com/estesp/manifest-tool/releases/download/v2.1.7/binaries-manifest-tool-2.1.7.tar.gz | tar xvz - mv manifest-tool-linux-amd64 ./manifest-tool - chmod +x ./manifest-tool timeout: 2 hours script: - ./manifest-tool --docker-cfg "$DOCKER_AUTH_CONFIG" push from-args --platforms linux/amd64,linux/arm64 --template $DOCKER_REPO:$STREAMPLACE_VERSION-ARCH --tags $STREAMPLACE_BRANCH --target $DOCKER_REPO:$STREAMPLACE_VERSION
.build-android: stage: build interruptible: true image: "$DOCKER_REPO:builder-$DOCKERFILE_HASH" timeout: 2 hours script: - git fetch --unshallow || echo 'already unshallow' - make $TARGET -j$(nproc)
build-android-debug: extends: - .build-android variables: TARGET: ci-android-debug
build-android-release: extends: - .build-android variables: TARGET: ci-android-release
.build-on-mac: stage: build interruptible: true image: ghcr.io/cirruslabs/macos-tahoe-xcode:26.3 tags: - tart-installed variables: STREAMPLACE_TEST_COUNT: "1" NODE_OPTIONS: "--max_old_space_size=4096" timeout: 2 hours script: # workaround for https://gitlab.com/gitlab-org/gitlab/-/issues/501457 # which is a workaround for ios builds failing due to /tmp vs /private/tmp weirdness - cd .. - mv streamplace /Users/admin/streamplace - cd /Users/admin/streamplace - git fetch --unshallow || echo 'already unshallow' - brew install ninja go openssl@3 && go version - export PATH="/opt/homebrew/opt/node@22/bin:$PATH" - brew install node@22 - node --version - npm install -g corepack@latest --force - corepack enable - sudo gem uninstall xcodeproj -x --ignore-dependencies - sudo gem install xcodeproj -v 1.25.1 - curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs > rustup.sh && bash rustup.sh -y && rm rustup.sh - export PATH="$PATH:$HOME/.cargo/bin" - echo $PATH - 'echo "which xcodeproj: $(which xcodeproj)"' - 'echo "xcodeproj --version: $(xcodeproj --version)"' - "$(which xcodeproj) --version" - > export GOTOOLCHAIN=go1.26.5 && python3 -m pip install virtualenv && python3 -m virtualenv ~/venv && source ~/venv/bin/activate && python3 -m pip install meson && ${=COMMAND} # ^^ zsh-ism for running command with spaces
build-ios: extends: - .build-on-mac variables: COMMAND: make ci-ios -j16
build-desktop-darwin: extends: - .build-on-mac needs: - build-darwin-amd64 - build-darwin-arm64 variables: COMMAND: make ci-desktop-darwin
# windows-selftest:# interruptible: true# stage: build# # for the moment...# tags:# - windows# timeout: 2 hours# needs:# - job: build-windows-amd64# artifacts: true# variables:# MSYSTEM: "MINGW32"# CHERE_INVOKING: "yes"# script:# - C:\msys64\usr\bin\bash -lc "bash -x ./util/windows-selftest.sh $STREAMPLACE_DESKTOP_URL_WINDOWS_AMD64"
.release-template: stage: build interruptible: true image: "$DOCKER_REPO:builder-$DOCKERFILE_HASH" needs: # The linux build jobs upload the .deb / .tar.gz files that the release # jobs download from the package registry, so they must finish first. # They used to be pulled in transitively via the build-docker-* jobs; # those were removed, so depend on them directly to avoid a download race. - build-linux-amd64 - build-linux-arm64 - build-darwin-amd64 - build-darwin-arm64 - build-android-debug - build-android-release - build-docker-amd64 - build-docker-arm64 - build-docker-manifest - build-desktop-darwin - build-ios - test rules: - if: '$CI_COMMIT_TAG =~ /^v?\d+\.\d+\.\d+$/' timeout: 2 hours
npm-release: extends: - .release-template script: - make ci-npm-release
release: extends: - .release-template script: - make ci-release
deb-release: extends: - .release-template script: - make ci-deb-release
homebrew-release: extends: - .release-template script: - make ci-homebrew
.report-status: tags: - tiny-job interruptible: true image: name: curlimages/curl entrypoint: [""] variables: STATUS_PROJECT: streamplace/streamplace STATUS_NAME: git.stream.place script: # For complete details on the GitHub API please see: # https://developer.github.com/v3/repos/statuses - > set -eu && curl -L --fail-with-body --silent -X POST -H "Accept: application/vnd.github+json" -H "Authorization: Bearer $GITHUB_TOKEN" -H "X-GitHub-Api-Version: 2022-11-28" https://api.github.com/repos/${STATUS_PROJECT}/statuses/${CI_COMMIT_SHA} -d '{"state":"'${CI_JOB_NAME}'","target_url":"'${CI_PIPELINE_URL}'","description":"'${STATUS_NAME}'","context":"'${STATUS_NAME}'"}' environment: name: reporting-github dependencies: []
pending: stage: .pre extends: - .report-status
success: stage: .post extends: - .report-status
failure: stage: .post extends: - .report-status rules: - when: on_failure