From 7fdf1e42e9a3edaee8437c9b4d0a4d65fc2b6095 Mon Sep 17 00:00:00 2001 From: phoenix Date: Fri, 14 Mar 2025 20:05:30 -0400 Subject: [PATCH] Added stage to create tags --- .gitlab-ci.yml | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 9269c22..10942df 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -40,6 +40,27 @@ test_variable: rules: - if: '$CI_COMMIT_TAG' +extract_version: + stage: version + image: alpine:latest + script: + - apk add --no-cache jq + - VERSION=$(jq -r '.package.version' Cargo.toml) + - echo "Version: $VERSION" + - echo "VERSION=$VERSION" > version.env + artifacts: + reports: + dotenv: version.env +tag_release: + stage: deploy + image: registry.gitlab.com/gitlab-org/release-cli:latest + rules: + - if: '$CI_COMMIT_BRANCH == "main" && $CI_PIPELINE_SOURCE == "push"' + dependencies: + - extract_version + script: + - release-cli create --name "Release $VERSION" --tag-name "v$VERSION" + deploy: stage: deploy image: rust:1.85