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

Improve release script #917

Open
wants to merge 17 commits into
base: main
Choose a base branch
from
Open

Conversation

plbstl
Copy link

@plbstl plbstl commented Jul 1, 2024

This PR updates the release script to be slightly more robust, and updates related documentation.

The new implementation:

  • Improves debug messages
  • Retrieves semver tag from a commit with duplicate tags (e.g. v2, v2.1.2)
  • Retrieves the latest release tag from current branch only
  • Pushes the new release tag along with necessary commits to remote
  • Works with only annotated tags
  • Updates the separate major tag to point to the new release
  • Terminates the script when a command fails
  • Boldens the colored text in terminal
  • Uses full flags for commands, where applicable
  • Auto-detects major releases
  • Creates a releases/v# branch for the previous major version, when creating a major release

plbstl added 13 commits July 1, 2024 02:17
- When using the [action versioning recommendations](https://github.com/actions/toolkit/blob/master/docs/action-versioning.md#recommendations), a commit can have duplicate tags (v2, v2.1.2).
- The previous implementation did not take that into consideration.
- With this new implementation, v2.1.2 is returned even when v2 is the newer commit tag (which is usually the case).
- Also, when running this script from another branch (let's say 'releases/v1'), the previous implementation would return newer tags in other branches.
- NOTE: This new implementation only searches for annotated tags.
- Previously, when the git push command failed, the script would still echo a success message.
- This commit also makes sure the git describe command does not terminate the script.
- Using `--follow-tags` instead of `--tags` can be the saner option
- `follow-tags` also pushes commits
This implementation also creates a `releases/v#` branch off of the previous major version tag
@plbstl plbstl requested a review from a team as a code owner July 1, 2024 03:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant