Skip to content

Commit

Permalink
Fix release-notes in Makefile
Browse files Browse the repository at this point in the history
Signed-off-by: Peppi-Lotta <peppi-lotta.saari@est.tech>
  • Loading branch information
peppi-lotta committed Dec 13, 2024
1 parent 8e0504d commit 16d228a
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 6 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
9 changes: 7 additions & 2 deletions docs/releasing.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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.

Expand Down
6 changes: 3 additions & 3 deletions hack/tools/release/notes.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 16d228a

Please sign in to comment.