Merge branch 'tag_init' into 'main'

Added stage to create tags

See merge request kdeng00/icarus-models!26
This commit is contained in:
KD
2025-03-15 00:43:23 +00:00
2 changed files with 28 additions and 2 deletions

View File

@@ -1,6 +1,7 @@
stages:
- build
- test
- version
- deploy
build:
@@ -40,6 +41,30 @@ test_variable:
rules:
- if: '$CI_COMMIT_TAG'
extract_version:
stage: version
image: alpine:latest
script:
- apk add --no-cache jq
- VERSION=$(grep 'version = "' Cargo.toml | awk -F'"' '{print $2}' | head -n 1)
- if [ $? -ne 0 ]; then echo "Error extracting version"; exit 1; fi
- echo "Extracted version is"
- echo "$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 v$VERSION" --tag-name "v$VERSION"
deploy:
stage: deploy
image: rust:1.85
@@ -53,3 +78,4 @@ deploy:
- build
rules:
- if: '$CI_COMMIT_TAG'

View File

@@ -1,9 +1,9 @@
[package]
name = "icarus-models"
description = "models used for the icarus project"
license = "MIT"
version = "0.1.7"
edition = "2024"
description = "models used for the icarus project"
license = "MIT"
[dependencies]
serde = { version = "1.0.218", features = ["derive"] }