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

dist release command for preparing releases #1546

Open
duckinator opened this issue Nov 11, 2024 · 0 comments
Open

dist release command for preparing releases #1546

duckinator opened this issue Nov 11, 2024 · 0 comments

Comments

@duckinator
Copy link
Contributor

This issue serves as a (hopefully) actionable idea for implementing a dist release subcommand.

NOTES:

  1. dist release should be configurable to not manage tags automatically, so a PR-based workflow can be used.
  2. Commits and tags should be marked as being created by dist release, e.g. by adding something like Created with dist release <major|minor|patch>. at the end of commit messages and tag annotations.
  3. If we annotate the tag with git tag -m $MESSAGE $TAG, we can do git push --follow-tags $BRANCH to push the commit and the tag at the same time. Conveniently, note 2 would address this.

dist release <major|minor|patch>:

  1. Bump version number (as indicated by which of <major|minor|patch> is passed).
  2. Run cargo test -- this both ensures things like Cargo.toml are up to date, and also ensures we fail early to minimize wasted time.
  3. Create a release commit.
  4. Create a release tag, unless configured to ignore it.
  5. Push the release commit and, if created, also the tag.
  6. Push the release commit + tag.

dist release undo:

  1. Verify the last commit is from dist release <major|minor|patch>. Bail early if it's not. (We can't undo a commit that's had work done on top of it.)
  2. If configured to not manage tags, continue to the next step. Otherwise, verify the last tag is from dist release; bail early if it isn't.
  3. If configured to not manage tags, continue to the next step. Otherwise, verify the last tag points at the last commit; bail early if it doesn't.
  4. If managing tags, remove the tag.
  5. Remove the commit.

Maybe a dist release push?:

  1. Verify the last commit is created by dist release. Bail early if it's not.
  2. If configured to not manage tags, continue to the next step. Otherwise, verify the last tag is created by dist release; bail early if it isn't.
  3. If configured to not manage tags, continue to the next step. Otherwise, verify the last tag points at the last commit; bail early if it doesn't.
  4. If managing tags, push the last commit + last tag. Otherwise, push the last commit.

Related: #842

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

No branches or pull requests

1 participant