Skip to content
Snippets Groups Projects
Unverified Commit bf64e200 authored by Timo Furrer's avatar Timo Furrer
Browse files

Fix release make target

parent 78c8d9f0
No related branches found
No related tags found
No related merge requests found
...@@ -4,3 +4,10 @@ ...@@ -4,3 +4,10 @@
SEMANTIC_VERSION_REGEX='^(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(?:-((?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\.(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\+([0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?$' SEMANTIC_VERSION_REGEX='^(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(?:-((?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\.(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\+([0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?$'
cat - | grep -qE "$SEMANTIC_VERSION_REGEX" cat - | grep -qE "$SEMANTIC_VERSION_REGEX"
exit_code=$?
if [ $exit_code -ne 0 ]; then
echo "The given version doesn't match the semantic versioning format."
fi
exit $exit_code
...@@ -53,10 +53,12 @@ backports: ...@@ -53,10 +53,12 @@ backports:
.PHONY: release .PHONY: release
release: release:
@echo -n $(VERSION) | ./.gitlab/scripts/check-semantic-version.sh echo "Starting release process for $(VERSION) ..."
@[ "main" = "$(shell git rev-parse --abbrev-ref HEAD)" ] || echo "Please checkout the main branch first: git checkout main" @echo "$(VERSION)" | ./.gitlab/scripts/check-semantic-version.sh
@[ "main" = "$(shell git rev-parse --abbrev-ref HEAD)" ] || (echo "Please checkout the main branch first: git checkout main" && false)
@[ -n "$(GITLAB_TOKEN)" ] || (echo "Please set the GITLAB_TOKEN environment variable" && false)
@echo "Creating changelog ..." @echo "Creating changelog ..."
@curl --method POST --header "PRIVATE-TOKEN: $GITLAB_TOKEN" 'https://gitlab.com/api/v4/projects/components%2Fopentofu/repository/changelog' --data "version=$(VERSION)&message='Add changelog for $(VERSION) [skip ci]'" @curl --fail-with-body --request POST --header "PRIVATE-TOKEN: $(GITLAB_TOKEN)" 'https://gitlab.com/api/v4/projects/components%2Fopentofu/repository/changelog' --data "version=$(VERSION)&message='Add changelog for $(VERSION) [skip ci]'"
@echo "Pulling changelog ..." @echo "Pulling changelog ..."
@git pull @git pull
@echo "Tagging $(VERSION) ..." @echo "Tagging $(VERSION) ..."
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment