Guard uploads and release to main branch

This commit is contained in:
Greg Hellings
2025-02-06 14:45:51 -06:00
parent 570aa6ae52
commit 97f32fa9ea
+7 -1
View File
@@ -28,7 +28,10 @@ build:
script: script:
- nix build -L ".#${ARCH}" - nix build -L ".#${ARCH}"
- URL=$CI_API_V4_URL/projects/$CI_PROJECT_ID/packages/generic/sword-utils/$TAG/sword-${ARCH}-${TAG}.tar.xz - URL=$CI_API_V4_URL/projects/$CI_PROJECT_ID/packages/generic/sword-utils/$TAG/sword-${ARCH}-${TAG}.tar.xz
- 'curl -i --fail-with-body --header "JOB-TOKEN: $CI_JOB_TOKEN" --upload-file ./result/sword.tar.xz "${URL}"' - >-
if [ "$CI_COMMIT_BRANCH" == "main" ]; then
'curl -i --fail-with-body --header "JOB-TOKEN: $CI_JOB_TOKEN" --upload-file ./sword.tar.xz "${URL}"'
fi
- echo "${ARCH}_TARBALL=${URL}" > build.env - echo "${ARCH}_TARBALL=${URL}" > build.env
artifacts: artifacts:
reports: reports:
@@ -37,6 +40,9 @@ build:
"Create release": "Create release":
stage: release stage: release
image: registry.gitlab.com/gitlab-org/release-cli:latest image: registry.gitlab.com/gitlab-org/release-cli:latest
rules:
- if: $CI_COMMIT_BRANCH == "main"
when: always
needs: needs:
- job: check - job: check
artifacts: true artifacts: true