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

Introduce changelog and release make target

parent 7f2d2300
Branches
Tags
No related merge requests found
...@@ -208,7 +208,8 @@ plan: ...@@ -208,7 +208,8 @@ plan:
## Releases & Versioning ## Releases & Versioning
This project currently releases tagged commits. This project currently releases tagged commits.
An overview of releases can be found on the [Releases page](https://gitlab.com/components/opentofu/-/releases). An overview of releases can be found on the [Releases page](https://gitlab.com/components/opentofu/-/releases)
and a Changelog can be found [here](CHANGELOG.md).
Each release is accessible in the [CI/CD Catalog](https://gitlab.com/explore/catalog). Each release is accessible in the [CI/CD Catalog](https://gitlab.com/explore/catalog).
......
# See https://docs.gitlab.com/ee/user/project/changelogs.html
# For API see https://docs.gitlab.com/ee/api/repositories.html#add-changelog-data-to-a-changelog-file
# Defines the category mapping for the markdown rendering
# trailer -> display name in markdown
categories:
added: Added
fixed: Fixed
changed: Changed
deprecated: Deprecated
removed: Removed
security: Security
performance: Performance
other: Other
Release $CI_COMMIT_TAG of components repository $CI_PROJECT_PATH. Release $CI_COMMIT_TAG of components repository $CI_PROJECT_PATH.
See the [CHANGELOG](CHANGELOG.md) for what changes happened in this release.
## Usage ## Usage
You can use the OpenTofu CI/CD component from the CI/CD catalog using: You can use the OpenTofu CI/CD component from the CI/CD catalog using:
......
...@@ -29,3 +29,9 @@ That is, they are not bundled and it's not possible to use a component across in ...@@ -29,3 +29,9 @@ That is, they are not bundled and it's not possible to use a component across in
The OpenTofu CI/CD job and pipeline templates can be generated using `make backports`. The OpenTofu CI/CD job and pipeline templates can be generated using `make backports`.
The output is generated into the `backports` folder. The output is generated into the `backports` folder.
Please contribute those files only upon full manual inspection to the canonical GitLab repository. Please contribute those files only upon full manual inspection to the canonical GitLab repository.
## Releasing
Use the `make release` command with the `VERSION` argument set to the
version of the new release, like: `make release VERSION=1.0.0`.
The version must adhere to the [Semantic Versioning](https://semver.org) format.
...@@ -50,3 +50,17 @@ backports: ...@@ -50,3 +50,17 @@ backports:
@yq e 'del(.*.variables | select(length==0))' $(BACKPORTS_BASE_FILE) | diff -Bw $(BACKPORTS_BASE_FILE) - | patch $(BACKPORTS_BASE_FILE) - @yq e 'del(.*.variables | select(length==0))' $(BACKPORTS_BASE_FILE) | diff -Bw $(BACKPORTS_BASE_FILE) - | patch $(BACKPORTS_BASE_FILE) -
@echo "Generated $(BACKPORTS_BASE_FILE)" @echo "Generated $(BACKPORTS_BASE_FILE)"
.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 "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]'"
@echo "Pulling changelog ..."
@git pull
@echo "Tagging $(VERSION) ..."
@git tag $(VERSION)
@echo "Pushing tag $(VERSION) ..."
@git push origin $(VERSION)
@echo "Created tag $(VERSION), pipeline triggered, release will be available soon!"
...@@ -231,7 +231,8 @@ plan: ...@@ -231,7 +231,8 @@ plan:
## Releases & Versioning ## Releases & Versioning
This project currently releases tagged commits. This project currently releases tagged commits.
An overview of releases can be found on the [Releases page](https://gitlab.com/components/opentofu/-/releases). An overview of releases can be found on the [Releases page](https://gitlab.com/components/opentofu/-/releases)
and a Changelog can be found [here](CHANGELOG.md).
Each release is accessible in the [CI/CD Catalog](https://gitlab.com/explore/catalog). Each release is accessible in the [CI/CD Catalog](https://gitlab.com/explore/catalog).
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment