Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🐛 Fix release-notes in Makefile #786

Merged
merged 1 commit into from
Dec 20, 2024
Merged
Show file tree
Hide file tree
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
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
11 changes: 8 additions & 3 deletions docs/releasing.md
Original file line number Diff line number Diff line change
Expand Up @@ -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`
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 hash from latestTag %s: %v", latestTag, err)
}

cmd := exec.Command("git", "rev-list", lastTag+".."+commitHash, "--merges", "--pretty=format:%B") // #nosec G204:gosec
Expand Down
Loading