Skip to content
This repository has been archived by the owner on Apr 25, 2023. It is now read-only.

Commit

Permalink
build: Use gh release notes API to generate release notes
Browse files Browse the repository at this point in the history
  • Loading branch information
jimmidyson committed May 18, 2022
1 parent 2febb64 commit 1505a0b
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 19 deletions.
23 changes: 13 additions & 10 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,17 @@
# Unreleased

# v0.9.2
- [#1476](https://github.com/kubernetes-sigs/kubefed/pull/1476)
feat: Introduce cluster config malformed condition to KubeFedCluster
- [#1492](https://github.com/kubernetes-sigs/kubefed/pull/1492)
feat: Upgrade to controller-runtime 0.10.3
- [#1499](https://github.com/kubernetes-sigs/kubefed/pull/1499)
fix: Ignore non-targeted clusters during deletion
- [#1501](https://github.com/kubernetes-sigs/kubefed/pull/1501)
feat: Introduce Kubernetes version to status of KubeFedCluster

## What's Changed
* Introduce cluster config malformed condition to KubeFedCluster by @zqzten in https://github.com/kubernetes-sigs/kubefed/pull/1476
* Handle possible conflict in updating test labels on cluster by @irfanurrehman in https://github.com/kubernetes-sigs/kubefed/pull/1500
* Introduce Kubernetes version to status of KubeFedCluster by @zqzten in https://github.com/kubernetes-sigs/kubefed/pull/1501
* Ignore non-targeted clusters during deletion by @jonathanbeber in https://github.com/kubernetes-sigs/kubefed/pull/1499
* Update runtime-controller v0.10.3 by @tehlers320 in https://github.com/kubernetes-sigs/kubefed/pull/1492

## New Contributors
* @jonathanbeber made their first contribution in https://github.com/kubernetes-sigs/kubefed/pull/1499
* @tehlers320 made their first contribution in https://github.com/kubernetes-sigs/kubefed/pull/1492

**Full Changelog**: https://github.com/kubernetes-sigs/kubefed/compare/v0.9.1...v0.9.2

# v0.9.1
- [#1490](https://github.com/kubernetes-sigs/kubefed/pull/1490)
Expand Down
8 changes: 5 additions & 3 deletions scripts/build-release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -108,9 +108,11 @@ function verify-container-image() {
}

function update-changelog() {
if ! grep "^# ${RELEASE_TAG}" CHANGELOG.md &> /dev/null; then
sed -i "/# Unreleased/a \\\n# ${RELEASE_TAG}" CHANGELOG.md
fi
printf "%s\n\n%s\n" \
"$(gh api --method POST -H "Accept: application/vnd.github.v3+json" \
/repos/"${GITHUB_REPO}"/releases/generate-notes -f tag_name="${RELEASE_TAG}" \
-q '"# "+.name+"\n\n"+.body')" \
"$(cat CHANGELOG.md)" > CHANGELOG.md
}

if [[ ! "${RELEASE_TAG}" =~ ${RELEASE_TAG_REGEX} ]]; then
Expand Down
8 changes: 2 additions & 6 deletions scripts/create-gh-release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -51,13 +51,9 @@ function verify-assets-file-exists() {

function github-release-template() {
# Add leading # for markdown heading level 1 (h1)
local regex="${RELEASE_TAG_REGEX/^/^\# })"
local regex="${RELEASE_TAG_REGEX/^/^\# }"
cat <<EOF
${RELEASE_TAG}
## Changelog
$(sed -E "1,/${regex}/d ; /${regex}/,\$d" CHANGELOG.md)
$(sed -En "/^# ${RELEASE_TAG}/,/${regex}/p" CHANGELOG.md | head -n-2)
## Artifacts
Expand Down

0 comments on commit 1505a0b

Please sign in to comment.