Merge branch 'tag_init' into 'main'
Added stage to create tags See merge request kdeng00/icarus-models!26
This commit is contained in:
@@ -1,6 +1,7 @@
|
|||||||
stages:
|
stages:
|
||||||
- build
|
- build
|
||||||
- test
|
- test
|
||||||
|
- version
|
||||||
- deploy
|
- deploy
|
||||||
|
|
||||||
build:
|
build:
|
||||||
@@ -40,6 +41,30 @@ 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=$(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:
|
deploy:
|
||||||
stage: deploy
|
stage: deploy
|
||||||
image: rust:1.85
|
image: rust:1.85
|
||||||
@@ -53,3 +78,4 @@ deploy:
|
|||||||
- build
|
- build
|
||||||
rules:
|
rules:
|
||||||
- if: '$CI_COMMIT_TAG'
|
- if: '$CI_COMMIT_TAG'
|
||||||
|
|
||||||
|
@@ -1,9 +1,9 @@
|
|||||||
[package]
|
[package]
|
||||||
name = "icarus-models"
|
name = "icarus-models"
|
||||||
description = "models used for the icarus project"
|
|
||||||
license = "MIT"
|
|
||||||
version = "0.1.7"
|
version = "0.1.7"
|
||||||
edition = "2024"
|
edition = "2024"
|
||||||
|
description = "models used for the icarus project"
|
||||||
|
license = "MIT"
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
serde = { version = "1.0.218", features = ["derive"] }
|
serde = { version = "1.0.218", features = ["derive"] }
|
||||||
|
Reference in New Issue
Block a user