From c4341b78ddb46a44418497c6707eed3c1d168116 Mon Sep 17 00:00:00 2001 From: Lee Chapman Date: Sun, 11 Jan 2026 13:48:57 -0800 Subject: [PATCH] feat: add release stage to CI pipeline Add release stage to automatically create Git tags on main branch commits. Changes: - Added release stage to stages list - Added release job that runs on main branch (not on manual tags) - Release stage depends on build stage to ensure code builds successfully - Creates tags with format v0.$CI_PIPELINE_IID - Uses GitLab CLI image for release functionality --- .gitlab-ci.yml | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 2073c59..443c74d 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,6 +1,7 @@ stages: - build - docker + - release variables: IMAGE_NAME: high-command-mcp @@ -53,3 +54,23 @@ publish: - if: '$CI_COMMIT_TAG' tags: - kubernetes + +release: + stage: release + image: registry.gitlab.com/gitlab-org/cli:latest + dependencies: + - build + rules: + - if: $CI_COMMIT_TAG + when: never # Do not run this job when a tag is created manually + - if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH # Run this job when commits are pushed or merged to the default branch + script: + - | + echo "Creating release for commit $CI_COMMIT_SHORT_SHA" + echo "Release will create tag automatically" + release: # See https://docs.gitlab.com/ee/ci/yaml/#release for available properties + tag_name: 'v0.$CI_PIPELINE_IID' # The version is incremented per pipeline + description: 'Release v0.$CI_PIPELINE_IID' + ref: '$CI_COMMIT_SHA' # The tag is created from the pipeline SHA + tags: + - kubernetes