Added stage to create tags
This commit is contained in:
@@ -40,6 +40,27 @@ test_variable:
|
|||||||
rules:
|
rules:
|
||||||
- if: '$CI_COMMIT_TAG'
|
- 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:
|
deploy:
|
||||||
stage: deploy
|
stage: deploy
|
||||||
image: rust:1.85
|
image: rust:1.85
|
||||||
|
Reference in New Issue
Block a user