adding cargo-semver-checks
@obi1kenobi 's cargo-semver-checks would likely improve our stability. let's use it! https://github.com/obi1kenobi/cargo-semver-checks
If you might be planning to switch to GitHub-workflow-based publishing, that'd be the easiest place to add cargo-semver-checks today.
It's also possible to use it on PRs, but the workflow there isn't as smooth or ergonomic yet! In that situation, I recommend having it configured as a job that's allowed to fail without breaking CI, so that breaking changes that are merged but not yet released don't break CI.
I'm happy to answer any questions and help you get started!
I'm more than happy to move to workflow based publishing. Do you have any recommendation/example with semver-checks?
I use GitHub workflows for publishing in almost all my repos — this setup is probably the most straightforward: https://github.com/obi1kenobi/trustfall-rustdoc-adapter/blob/83ffd07d4230dfc12ac900eae3393a1784b9ffc2/.github/workflows/ci.yml#L91-L163
The basic idea is:
- When running on the
mainbranch, first lint & test everything; then, - check if the version in
Cargo.tomlis already on crates.io; if not, then - run pre-publish checks like
cargo-semver-checks - run
cargo publish
To publish a new version, make a PR that bumps the version in Cargo.toml and Cargo.lock, and merge it. Post-merge, the CI run on the main branch will publish that version.
If you wanted to extend it with extra steps, the cargo-semver-checks repo's release workflow has some additional functionality, like tagging the version, creating a GitHub release, building & attaching binary artifacts to the release, etc.
Hello, can i work on this ? Thanks
Hello, can i work on this ? Thanks
Yes. feel free to open a PR