From 7be412aab274ba85b80505b270ae03d2e6fb959b Mon Sep 17 00:00:00 2001 From: Peppi-Lotta Date: Thu, 12 Dec 2024 15:28:28 +0200 Subject: [PATCH] Fix release-notes binary path in Makefile Signed-off-by: Peppi-Lotta --- Makefile | 2 +- docs/releasing.md | 11 ++++++++--- hack/tools/release/notes.go | 6 +++--- 3 files changed, 12 insertions(+), 7 deletions(-) diff --git a/Makefile b/Makefile index cd60d058..6c9f6a4d 100644 --- a/Makefile +++ b/Makefile @@ -305,7 +305,7 @@ release-manifests: $(KUSTOMIZE) $(RELEASE_DIR) ## Builds the manifests to publis .PHONY: release-notes-tool release-notes-tool: - go build -C hack/tools -o $(BIN_DIR) -tags tools github.com/metal3-io/ip-address-manager/hack/tools/release + go build -C hack/tools -o $(BIN_DIR)/release -tags tools github.com/metal3-io/ip-address-manager/hack/tools/release .PHONY: release-notes release-notes: $(RELEASE_NOTES_DIR) $(RELEASE_NOTES) release-notes-tool diff --git a/docs/releasing.md b/docs/releasing.md index b00db156..3e042d11 100644 --- a/docs/releasing.md +++ b/docs/releasing.md @@ -32,13 +32,16 @@ IPAM uses [semantic versioning](https://semver.org). ### Repository setup -Clone the repository from your intended fork: +- Clone the repository from your intended fork: `git clone git@github.com:[your-fork]/metal3-ipam.git` or if using existing repository, make sure origin is set to the fork and upstream is set to `metal3-io`. Verify if your remote is set properly or not by using following command `git remote -v`. +- Fetch the remote (`metal3-io`): `git fetch upstream` +This makes sure that all the tags are accessible. + ### Creating Release Notes - Switch to the main branch: `git checkout main` @@ -61,9 +64,11 @@ by using following command `git remote -v`. release, but not overwhelming the important changes contained by the release. -- Commit and push your changes, push the new branch and create a pull request. +- Commit your changes, push the new branch and create a pull request: IMPORTANT_NOTE: - - The commit and PR title should be 🚀 Release v1.x.y. + - The commit and PR title should be 🚀 Release v1.x.y: + -`git commit -S -s -m ":rocket: Release v1.x.x"` + -`git push -u origin release-notes-1.x.x` - Important! The commit should only contain the release notes file, nothing else, otherwise automation will not work. diff --git a/hack/tools/release/notes.go b/hack/tools/release/notes.go index 9378573a..e26196dc 100644 --- a/hack/tools/release/notes.go +++ b/hack/tools/release/notes.go @@ -125,16 +125,16 @@ func isMinor(tag string) bool { func run() int { latestTag, err := latestTag() if err != nil { - log.Fatal("Failed to get latestTag \n") + log.Fatalf("Failed to get latestTag: %v", err) } lastTag, err := lastTag(latestTag) if err != nil { - log.Fatal("Failed to get lastTag \n") + log.Fatalf("Failed to get lastTag: %v", err) } commitHash, err := getCommitHashFromNewTag(latestTag) if err != nil { - log.Fatalf("Failed to get commit has from latestTag %s", latestTag) + log.Fatalf("Failed to get commit hash from latestTag %s: %v", latestTag, err) } cmd := exec.Command("git", "rev-list", lastTag+".."+commitHash, "--merges", "--pretty=format:%B") // #nosec G204:gosec