From 638468c15e24fec46b8a8e3621440b1cee91c54b Mon Sep 17 00:00:00 2001 From: Timo Furrer <tfurrer@gitlab.com> Date: Tue, 16 Jan 2024 15:23:58 +0100 Subject: [PATCH] Add proper release notes --- .gitlab-ci.yml | 10 ++++++++-- .gitlab/release-template.md | 26 ++++++++++++++++++++++++++ 2 files changed, 34 insertions(+), 2 deletions(-) create mode 100644 .gitlab/release-template.md diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 9c7e1cc..25dd484 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -114,10 +114,16 @@ create-release: image: registry.gitlab.com/gitlab-org/release-cli:latest rules: - if: $CI_COMMIT_TAG =~ /\d+/ - script: echo "Creating release $CI_COMMIT_TAG" + before_script: + - apk add --update yq envsubst + script: + - echo "Creating release $CI_COMMIT_TAG" + - AVAILABLE_OPENTOFU_VERSIONS=$(yq -r '.spec.inputs.opentofu_version.options | .[] | "- [`" + . + "`](https://github.com/opentofu/opentofu/releases/tag/v" + . + ")"' templates/full-pipeline.yml) + - export AVAILABLE_OPENTOFU_VERSIONS + - cat .gitlab/release-template.md | envsubst > release-notes.md release: tag_name: $CI_COMMIT_TAG - description: "Release $CI_COMMIT_TAG of components repository $CI_PROJECT_PATH" + description: './release-notes.md' old-states: image: alpine:latest diff --git a/.gitlab/release-template.md b/.gitlab/release-template.md new file mode 100644 index 0000000..df8c42f --- /dev/null +++ b/.gitlab/release-template.md @@ -0,0 +1,26 @@ +Release $CI_COMMIT_TAG of components repository $CI_PROJECT_PATH. + +## Usage + +You can use the OpenTofu CI/CD component from the CI/CD catalog using: + +```yaml +include: + - component: gitlab.com/components/opentofu/full-pipeline@$CI_COMMIT_TAG + inputs: + # The version must currently be specified explicitly as an input, + # to find the correctly associated images. # This can be removed + # once https://gitlab.com/gitlab-org/gitlab/-/issues/438275 is solved. + version: $CI_COMMIT_TAG + opentofu_version: $LATEST_OPENTOFU_VERSION + +stages: [validate, test, build, deploy, cleanup] +``` + +See the [README.md](README.md) for more usage examples. + +## Available OpenTofu versions + +This release is available with the following OpenTofu versions: + +$AVAILABLE_OPENTOFU_VERSIONS -- GitLab