Skip to content

Commit

Permalink
chore: use release-tool to generate release notes
Browse files Browse the repository at this point in the history
Publish release notes to the GitHub release automatically.

Signed-off-by: Andrey Smirnov <smirnov.andrey@gmail.com>
  • Loading branch information
smira authored and talos-bot committed May 14, 2021
1 parent 056f8c2 commit cf383ab
Show file tree
Hide file tree
Showing 6 changed files with 66 additions and 55 deletions.
2 changes: 2 additions & 0 deletions .drone.yml
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,7 @@ steps:
pull: always
commands:
- make release
- make release-notes
when:
event:
- tag
Expand All @@ -163,6 +164,7 @@ steps:
draft: true
files:
- _out/infrastructure-sidero/*/*
note: _out/RELEASE_NOTES.md
when:
event:
- tag
Expand Down
4 changes: 4 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,10 @@ metal-controller-manager: ## Build the CAPI provider container image.
metal-metadata-server: ## Build the CAPI provider container image.
@$(MAKE) docker-$@ TARGET_ARGS="--push=$(PUSH)" NAME="$@"

.PHONY: release-notes
release-notes:
ARTIFACTS=$(ARTIFACTS) ./hack/release.sh $@ $(ARTIFACTS)/RELEASE_NOTES.md $(TAG)

# Sfyra

$(ARTIFACTS)/$(TALOS_RELEASE)/%:
Expand Down
22 changes: 0 additions & 22 deletions hack/chglog/CHANGELOG.tpl.md

This file was deleted.

28 changes: 0 additions & 28 deletions hack/chglog/config.yml

This file was deleted.

20 changes: 15 additions & 5 deletions hack/release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,26 @@

set -e

RELEASE_TOOL_IMAGE="ghcr.io/talos-systems/release-tool:latest"

function release-tool {
docker pull "${RELEASE_TOOL_IMAGE}" >/dev/null
docker run --rm -w /src -v "${PWD}":/src:ro "${RELEASE_TOOL_IMAGE}" -l -d -n -t "${1}" ./hack/release.toml
}

function changelog {
if [ "$#" -eq 1 ]; then
git-chglog --output CHANGELOG.md -c ./hack/chglog/config.yml --tag-filter-pattern "^${1}" "${1}.0-alpha.0.."
elif [ "$#" -eq 0 ]; then
git-chglog --output CHANGELOG.md -c ./hack/chglog/config.yml --sort=semver
(release-tool ${1}; echo; cat CHANGELOG.md) > CHANGELOG.md- && mv CHANGELOG.md- CHANGELOG.md
else
echo 1>&2 "Usage: $0 changelog [tag]"
exit 1
fi
}

function release-notes {
release-tool "${2}" > "${1}"
}

function cherry-pick {
if [ $# -ne 2 ]; then
echo 1>&2 "Usage: $0 cherry-pick <commit> <branch>"
Expand Down Expand Up @@ -42,9 +51,10 @@ then
else
cat <<EOF
Usage:
commit: Create the official release commit message.
commit: Create the official release commit message.
cherry-pick: Cherry-pick a commit into a release branch.
changelog: Update the specified CHANGELOG.
changelog: Update the specified CHANGELOG.
release-notes: Create release notes for GitHub release.
EOF

exit 1
Expand Down
45 changes: 45 additions & 0 deletions hack/release.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
# commit to be tagged for new release
commit = "HEAD"

project_name = "Sidero"
github_repo = "talos-systems/sidero"
match_deps = "^github.com/(talos-systems/[a-zA-Z0-9-]+)$"

# previous release
previous = "v0.2.0"

pre_release = true

preface = """\
"""

[notes]

[notes.ipxe-script]
title = "iPXE script"
description = """\
iPXE image delivered by Sidero (either `ipxe.efi` or `undionly.kpxe`) now containes embedded iPXE script to access Sidero iPXE server.
This change allows to simplify DHCP server setup to return only iPXE image without any additional `if`s.
"""

[notes.ipmi-discovery]
title = "IPMI Discovery and Automatic Setup"
description = """\
Sidero agent by default discovers BMC (IPMI) endpoint when it first runs on the server and provisions user for Sidero automatically.
This feature enables completely automated server and IPMI discovery on the agent boot.
Variable `SIDERO_CONTROLLER_MANAGER_AUTO_BMC_SETUP` can be used to disable this feature during install or upgrade of Sidero.
Additionally Sidero supports storing IMPI credentials in Kubernetes secrets referencing them from the Server object.
"""

[notes.any-serverclass]
title = "ServerClass `any`"
description = """\
Sidero now creates ServerClass `any` which matches all servers.
"""

[notes.install-variables]
title = "Install and Upgrade Variables"
description = """\
Some aspects of Sidero installation can now be [controlled](https://www.sidero.dev/docs/v0.3/getting-started/installation/) via environment variables or `clusterctl` variables.
"""

0 comments on commit cf383ab

Please sign in to comment.