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
Branches
No related tags found
No related merge requests found
......@@ -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-]+)*))?$'
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:
.PHONY: release
release:
@echo -n $(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"
echo "Starting release process for $(VERSION) ..."
@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 ..."
@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 ..."
@git pull
@echo "Tagging $(VERSION) ..."
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment