Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 8 additions & 9 deletions hack/generate-release-note.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,10 @@ OUTPUT=${2:-release-notes.md}
UPDATE_SITE=${3:-false}

install_cli() {
export PATH="$(go env GOPATH)/bin:${PATH}"
if ! [[ -x "$(command -v release-notes)" ]]; then
echo "CLI release-notes not found, installing..."
GO111MODULE=on go install k8s.io/release/cmd/release-notes@latest
GO111MODULE=on go install k8s.io/release/cmd/release-notes@v0.21.1
else
echo "CLI release-notes found, skip installing. If you want to upgrade, run 'GO111MODULE=on go install k8s.io/release/cmd/release-notes@latest'"
fi
Comment on lines 20 to 27
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This only installs if the binary isn't already found on PATH. If a release-notes binary already exists (any version), it skips the install entirely and uses whatever version is present. Since version is pinned, we should always use the pinned version.

Expand All @@ -30,19 +31,17 @@ generate() {
FROM_TAG=$1
TO_TAG=$2
BRANCH=$3
FROM_COMMIT=$(git rev-list --no-merges ${FROM_TAG}..${TO_TAG} | tail -1) # exclude the ${FROM_TAG} commit
TO_COMMIT=$(git rev-parse ${TO_TAG}^{commit})

echo "Generating release notes for ${FROM_TAG}..${TO_TAG} (${FROM_COMMIT}..${TO_COMMIT}) on branch ${BRANCH}"
echo "Generating release notes for ${FROM_TAG}..${TO_TAG} on branch ${BRANCH}"

rm -f ${OUTPUT}
release-notes --repo=cloud-provider-azure \
release-notes generate \
--repo=cloud-provider-azure \
--org=kubernetes-sigs \
--branch=${BRANCH} \
--start-sha=${FROM_COMMIT} \
--end-sha=${TO_COMMIT} \
--start-rev=${FROM_TAG} \
--end-rev=${TO_TAG} \
--skip-first-commit \
--markdown-links=true \
--required-author='' \
--output=${OUTPUT}

if [[ ! -s "${OUTPUT}" ]]; then
Expand Down
Loading