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..44322fdd 100644 --- a/docs/releasing.md +++ b/docs/releasing.md @@ -46,6 +46,9 @@ by using following command `git remote -v`. - Create a new branch for the release notes**: `git checkout -b release-notes-1.x.x origin/main` +- Fetch upstream (`metal3-io`): `git fetch upstream` + - This makes sure all the latest tags are accessable by the next step. + - Generate the release notes: `RELEASE_TAG=v1.x.x make release-notes` - Replace `v1.x.x` with the new release tag you're creating. - This command generates the release notes here @@ -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..852fa8b7 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 has from latestTag %s: %v", latestTag, err) } cmd := exec.Command("git", "rev-list", lastTag+".."+commitHash, "--merges", "--pretty=format:%B") // #nosec G204:gosec