From 9fc114c21d35fbbc3ad150c500f369d5703bcef5 Mon Sep 17 00:00:00 2001 From: TC Date: Tue, 1 Aug 2023 00:59:23 +0000 Subject: [PATCH] Adding release stage triggered by existence of a tag that matches the v+semver format --- .gitlab-ci.yml | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index ff740a31..7658a260 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -7,6 +7,7 @@ variables: stages: - test - build_packages + - release - distribute #before_script: @@ -51,6 +52,8 @@ delete_test_machine: create_build_machines: stage: build_packages + rules: + - if: '$CI_COMMIT_BRANCH =~ /v\d.+/' only: - stable tags: @@ -62,6 +65,8 @@ create_build_machines: package_amd64_deb: stage: build_packages + rules: + - if: '$CI_COMMIT_BRANCH =~ /v\d.+/' only: - stable needs: @@ -75,6 +80,8 @@ package_amd64_deb: package_arm64_deb: stage: build_packages + rules: + - if: '$CI_COMMIT_BRANCH =~ /v\d.+/' only: - stable needs: @@ -88,6 +95,8 @@ package_arm64_deb: package_amd64_rpm: stage: build_packages + rules: + - if: '$CI_COMMIT_BRANCH =~ /v\d.+/' only: - stable needs: @@ -99,8 +108,21 @@ package_amd64_rpm: - earthly +package-linux-amd64-rpm - /home/gitlab-runner/scp-to-orchestrator.sh +release_job: + stage: release + image: registry.gitlab.com/gitlab-org/release-cli:latest + rules: + - if: '$CI_COMMIT_BRANCH =~ /v\d.+/' # Run this job when a tag is created + script: + - echo "running release_job" + release: # See https://docs.gitlab.com/ee/ci/yaml/#release for available properties + tag_name: '$CI_COMMIT_TAG' + description: '$CI_COMMIT_TAG' + build_repositories: stage: distribute + rules: + - if: '$CI_COMMIT_BRANCH =~ /v\d.+/' only: - stable tags: @@ -110,6 +132,8 @@ build_repositories: deploy_repos: stage: distribute + rules: + - if: '$CI_COMMIT_BRANCH =~ /v\d.+/' only: - stable needs: @@ -121,6 +145,8 @@ deploy_repos: delete_build_machines: stage: distribute + rules: + - if: '$CI_COMMIT_BRANCH =~ /v\d.+/' only: - stable tags: