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

Set cargo-release up #2090

Merged
merged 8 commits into from
Apr 9, 2024
Merged

Set cargo-release up #2090

merged 8 commits into from
Apr 9, 2024

Conversation

aumetra
Copy link
Member

@aumetra aumetra commented Apr 5, 2024

This PR sets up the cargo-release tool for the workspace

About the automatic changelog update, if we would define this on the workspace level, it would execute the replacements on the Changelog for each package in the workspace.

This is not what we want, so I simply chose a single package (cosmwasm-vm in this case) that contains the replacement rules.


In short, when running cargo release minor -x, the cargo-release tool will bump all the versions of the tools across the workspace by a minor version bump and runs cargo publish on all crates that aren't explicitly defined with a publish = false.

It also replaces Unreleased - ReleaseDate in the changelog with the new version and today's date, and creates a new section in the changelog for unreleased changes.


If you want to try this yourself:

  1. Install cargo-release
  2. Run cargo release minor -v

The default behaviour of the tool is to run in dry-run mode, so this won't break anything (use -x to actually execute anything). And the -v will tell you what the tool is about to do.

@aumetra
Copy link
Member Author

aumetra commented Apr 8, 2024

This does pretty much everything the set_version.sh script used to do, minus running build over the entire workspace and the contracts.

Question is: Do we need this or do we trust the CI to have caught everything?

@aumetra aumetra force-pushed the aw/cargo-release branch from 6f7f17f to 3298c87 Compare April 8, 2024 10:14
@chipshort
Copy link
Collaborator

Question is: Do we need this or do we trust the CI to have caught everything?

In general, CI will catch this, but if we do something like a security patch on multiple versions, it would be nice to have this step, since I probably will not push and wait for CI for all of them. Maybe we just add a publish.sh that does the compiles and uses cargo release (first dry-run, then ask before -x?)

@aumetra
Copy link
Member Author

aumetra commented Apr 8, 2024

Maybe we just add a publish.sh that does the compiles and uses cargo release (first dry-run, then ask before -x?)

Actually, I did an a little nicer fix to this. The checks are now run as part of the cargo-release pipeline. If anything errors out, the release process will stop.
The checks were copied from the old set_version.sh script.

@aumetra aumetra force-pushed the aw/cargo-release branch from fdaaa56 to d90593a Compare April 8, 2024 11:42
@aumetra aumetra requested a review from chipshort April 8, 2024 12:51
@aumetra aumetra requested a review from chipshort April 8, 2024 16:03
Copy link
Collaborator

@chipshort chipshort left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@aumetra aumetra merged commit a2a6a35 into main Apr 9, 2024
29 checks passed
@aumetra aumetra deleted the aw/cargo-release branch April 9, 2024 13:39
@chipshort
Copy link
Collaborator

@aumetra Could you update the wiki entry about releasing to reflect the new workflow? I guess it will be a lot shorter now ^^
Maybe just put a few sentences there that we are using cargo-release, to run dry-run, check it, then with -x to do it for real.

@aumetra
Copy link
Member Author

aumetra commented Apr 9, 2024

@chipshort Updated it. Kept it short and simple, let me know if you think there is something that should be clarified

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.

2 participants