Skip to content

Commit

Permalink
šŸ› Set previous release tag version for RELEASE CANDIDATE/BETA RELEASE (ā€¦
Browse files Browse the repository at this point in the history
ā€¦#10435)

* Set previous release tag version for RELEASE CANDIDATE/BETA RELEASE

Signed-off-by: chandankumar4 <chandan.kr404@gmail.com>

* Remove unused variable and update release-notes cmd

Signed-off-by: chandankumar4 <chandan.kr404@gmail.com>

* Update release process document

Signed-off-by: chandankumar4 <chandan.kr404@gmail.com>

* Add notes for first pre-release version

Signed-off-by: chandankumar4 <chandan.kr404@gmail.com>

* Replace PREVIOUS_VERSION_TAG with PREVIOUS_RELEASE_TAG

Signed-off-by: chandankumar4 <chandan.kr404@gmail.com>

---------

Signed-off-by: chandankumar4 <chandan.kr404@gmail.com>
  • Loading branch information
chandankumar4 authored Aug 6, 2024
1 parent b5568cf commit cefe990
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 20 deletions.
7 changes: 1 addition & 6 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -999,11 +999,6 @@ serve-book: ## Build and serve the book (with live-reload)

## latest git tag for the commit, e.g., v0.3.10
RELEASE_TAG ?= $(shell git describe --abbrev=0 2>/dev/null)
ifneq (,$(findstring -,$(RELEASE_TAG)))
PRE_RELEASE=true
endif
# the previous release tag, e.g., v0.3.9, excluding pre-release tags
PREVIOUS_TAG ?= $(shell git tag -l | grep -E "^v[0-9]+\.[0-9]+\.[0-9]+$$" | sort -V | grep -B1 $(RELEASE_TAG) | head -n 1 2>/dev/null)
## set by Prow, ref name of the base branch, e.g., main
RELEASE_ALIAS_TAG := $(PULL_BASE_REF)
RELEASE_DIR := out
Expand Down Expand Up @@ -1180,7 +1175,7 @@ release-notes-tool:

.PHONY: release-notes
release-notes: release-notes-tool
./bin/notes --release $(RELEASE_TAG) > CHANGELOG/$(RELEASE_TAG).md
./bin/notes --release $(RELEASE_TAG) --previous-release-version "$(PREVIOUS_RELEASE_TAG)" > CHANGELOG/$(RELEASE_TAG).md

.PHONY: test-release-notes-tool
test-release-notes-tool:
Expand Down
19 changes: 13 additions & 6 deletions docs/release/release-tasks.md
Original file line number Diff line number Diff line change
Expand Up @@ -361,15 +361,22 @@ The goal of this task is to keep the CAPI community updated on recent PRs that h
#### Create PR for release notes
1. Checkout the `main` branch.
1. Generate release notes with:
2. Generate release notes with:
1. RELEASE CANDIDATE/BETA RELEASE example:
```bash
# RELEASE_TAG should be the new desired tag (note: at this point the tag does not yet exist).
# Can be also used for pre-releases. The warning banner for RC and beta releases will be determined automatically.
RELEASE_TAG=v1.6.x make release-notes
# PREVIOUS_RELEASE_TAG is the previous released tag for determining the changes.
RELEASE_TAG=v1.7.x-rc.1 PREVIOUS_RELEASE_TAG=tags/v1.7.x-rc.0 make release-notes
```
**Note**: For a first pre-release version without a pre-release precedent, use above command without `PREVIOUS_RELEASE_TAG`.
2. STABLE RELEASE example
```bash
# RELEASE_TAG should be the new desired tag (note: at this point the tag does not yet exist).
RELEASE_TAG=v1.7.x make release-notes
```
1. This will generate a new release notes file at `CHANGELOG/<RELEASE_TAG>.md`. Finalize the release notes:
3. This will generate a new release notes file at `CHANGELOG/<RELEASE_TAG>.md`. Finalize the release notes:
- [ ] Look for any `MISSING_AREA` entries. Add the corresponding label to the PR and regenerate the notes.
- [ ] Look for any `MULTIPLE_AREAS` entries. If the PR does indeed guarantee multiple areas, just remove the `MULTIPLE_AREAS` prefix and just leave the areas. Otherwise, fix the labels in the PR and regenerate the notes.
- [ ] Review that all areas are correctly assigned to each PR. If not, correct the labels and regenerate the notes.
Expand All @@ -382,8 +389,8 @@ The goal of this task is to keep the CAPI community updated on recent PRs that h
- [ ] Sort manually all entries if you made any manual edits that might have altered the correct order.
- [ ] **For minor releases:** Modify `Changes since v1.x.y` to `Changes since v1.x`
<br>**Note**: The release notes tool includes all merges since the previous release branch was branched of.
1. Checkout `main`, branch out from it and add `CHANGELOG/<RELEASE_TAG>.md`.
1. Open a pull request **against the main branch** with all manual edits to `CHANGELOG/<RELEASE_TAG>.md` which is used for the new release notes. The commit and PR title should be `šŸš€ Release v1.x.y`.
4. Checkout `main`, branch out from it and add `CHANGELOG/<RELEASE_TAG>.md`.
5. Open a pull request **against the main branch** with all manual edits to `CHANGELOG/<RELEASE_TAG>.md` which is used for the new release notes. The commit and PR title should be `šŸš€ Release v1.x.y`.
<br>**Note**: Important! The commit should only contain the release notes file, nothing else, otherwise automation will not work.
Expand Down
10 changes: 2 additions & 8 deletions hack/tools/release/notes/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ func newNotesCmd() *notesCmd {

func (cmd *notesCmd) run() error {
releaseType := releaseTypeFromNewTag(cmd.config.newTag)
if err := validateConfig(cmd.config, releaseType); err != nil {
if err := validateConfig(cmd.config); err != nil {
return err
}

Expand Down Expand Up @@ -166,7 +166,7 @@ func commandExists(cmd string) bool {
return err == nil
}

func validateConfig(config *notesCmdConfig, releaseType string) error {
func validateConfig(config *notesCmdConfig) error {
if config.fromRef == "" && config.newTag == "" {
return errors.New("at least one of --from or --release need to be set")
}
Expand All @@ -187,12 +187,6 @@ func validateConfig(config *notesCmdConfig, releaseType string) error {
}
}

if releaseType != "" {
if config.previousReleaseVersion == "" {
return errors.New("--previous-release-version need to be set with RELEASE CANDIDATE/BETA RELEASE tag")
}
}

return nil
}

Expand Down

0 comments on commit cefe990

Please sign in to comment.