Guard uploads and release to main branch
This commit is contained in:
+7
-1
@@ -28,7 +28,10 @@ build:
|
||||
script:
|
||||
- nix build -L ".#${ARCH}"
|
||||
- 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
|
||||
artifacts:
|
||||
reports:
|
||||
@@ -37,6 +40,9 @@ build:
|
||||
"Create release":
|
||||
stage: release
|
||||
image: registry.gitlab.com/gitlab-org/release-cli:latest
|
||||
rules:
|
||||
- if: $CI_COMMIT_BRANCH == "main"
|
||||
when: always
|
||||
needs:
|
||||
- job: check
|
||||
artifacts: true
|
||||
|
||||
Reference in New Issue
Block a user