Skip to content
Snippets Groups Projects
Unverified Commit 6550e041 authored by Andrew Newdigate's avatar Andrew Newdigate
Browse files

feat: allow Goreleaser to run on default branch

parent 06b2be5a
No related branches found
No related tags found
No related merge requests found
Pipeline #23198664 passed
Loading
Loading
@@ -6,6 +6,10 @@ spec:
default: release
docker_hub_host:
default: docker.io
# When set to true, goreleaser will run on default branch, not on tags
release_on_main_branch:
default: "false"
---
 
include:
Loading
Loading
@@ -251,8 +255,25 @@ goreleaser:
- .goreleaser_auth_config # Configure vault or variables, from internal/goreleaser/*
stage: $[[ inputs.release_stage ]]
variables:
GL_COMMON_CI_TASKS_GORELEASER_ARGUMENTS_RUN_ON_MAIN: $[[ inputs.release_on_main_branch ]]
GL_COMMON_CI_TASKS_GORELEASER_ARGUMENTS: release --clean
rules:
- if: '$FIPS_MODE == "1" && $GL_COMMON_CI_TASKS_GORELEASER_ARGUMENTS_RUN_ON_MAIN == "true" && $CI_PIPELINE_SOURCE != "push" && $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH'
exists:
- .goreleaser.yml
variables:
GL_COMMON_CI_TASKS_GORELEASER_MESSAGE: Running go-releaser release in FIPS mode for main branch
GL_COMMON_CI_TASKS_GORELEASER_IMAGE: registry.gitlab.com/gitlab-com/gl-infra/common-ci-tasks-images/goreleaser-golang-fips:${GL_ASDF_GOLANG_VERSION}-${GL_ASDF_GORELEASER_VERSION}
GL_COMMON_CI_TASKS_GORELEASER_ARGUMENTS: release --clean --snapshot
- if: '$GL_COMMON_CI_TASKS_GORELEASER_ARGUMENTS_RUN_ON_MAIN == "true" && $CI_PIPELINE_SOURCE != "push" && $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH'
exists:
- .goreleaser.yml
variables:
GL_COMMON_CI_TASKS_GORELEASER_MESSAGE: Running go-releaser release in non-FIPS mode for main branch
GL_COMMON_CI_TASKS_GORELEASER_IMAGE: registry.gitlab.com/gitlab-com/gl-infra/common-ci-tasks-images/goreleaser:${GL_ASDF_GORELEASER_VERSION}
GL_COMMON_CI_TASKS_GORELEASER_ARGUMENTS: release --clean --snapshot
# Only run this release job for tags, not every commit
- if: $CI_COMMIT_TAG == "" || $CI_COMMIT_TAG == null
when: never
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment