Skip to content

Instantly share code, notes, and snippets.

@daym
Created August 25, 2023 19:15
Show Gist options
  • Select an option

  • Save daym/99de6568e20c54e092cc0574732b0c68 to your computer and use it in GitHub Desktop.

Select an option

Save daym/99de6568e20c54e092cc0574732b0c68 to your computer and use it in GitHub Desktop.
steveklabnik (he/him): it's interesting because for my crates I've standardized on a workflow where pushing a tag creates a release (and publishes to crates.io) from CI
rain: I'd definitely give cargo-dist a shot for new CLI tools. (I had a conversation with Gankra and she said she was "amazed" at the tooling I'd built up around nextest lol, but it does make it hard to use ca
rgo-dist for now)
rain: daym: Yeah, I use it for nextest to do releases from CI. It works pretty well
dap: We use this for dropshot and steno. It solves a useful task well enough. I wouldn't say I love it.
OK: cargo-release
weird nits:
It will release no matter what
If ssh is unavailable, it will have published already but failed ssh and then not allow you to try again. If you change version number it will publish even without changes. But there will be a
warning ONCE IT WORKED ONCE.
It doesn't add an actual release to github release page (but does add a tag)
cargo release changes
Explicit version: cargo release -- 0.1.0+1.54
Ensure you are in a good state: Right branch, up-to-date with remote, clean tree
Supports workspaces; change detection, optionally share commits
Handles cargo publish, tagging and pushing
Pre-release search and replace for custom version updates; including updating changelogs and updating tags in dockerfiles
Pre-release hook for extra customization
pre-release-hook = ["git", "cliff", "-o", "CHANGELOG.md", "--tag", "{{version}}" ]
cargo-dist
Well thought out
cargo dist init
Very quick: You setup with cargo dist init --ci=github, you can run simple local builds with cargo dist build, and you run CI builds by pushing a git tag to your repo
RFC https://github.com/axodotdev/cargo-dist/issues/111
Book https://opensource.axo.dev/cargo-dist/book/
Docs https://opensource.axo.dev/cargo-dist/book/way-too-quickstart.html
Uses cargo-inst for updating snapshot tests
!! Uses cargo-release
cut a release on github CI
pick good build flags for production
making zips and installers
Generating machine-readable manifest
Uploading all the resulting artifacts to a Github Release; Github Release is not the same as Github CI
release-plz
automate your release process
generate changelog (via git-cliff)
! create github/gitea releases
! push to cargo registry
!! Bump version in Cargo.toml
!! Release-plz updates your packages with a release Pull Request! (git history, API breaking changes! via cargo-semver-checks)
release-please: release-plz is inspired by release-please, but instead of determining the next versions based on git tags, release-plz compares local packages with the ones published in the cargo registry. Plus, release-plz doesn't need any configuration and is optimized for Rust projects.
cargo-smart-release
[INFO ] Manifest version of provided package 'toy-apcb' at 0.2.0 is sufficient to succeed latest released version 0.1.7, ignoring computed version 0.2.1
[WARN ] To create github releases, please install the 'gh' program and try again
Knows idempotency
Interesting: User can put "feat!: " into commit message in order to mark breaking changes
Autoincr version number intelligently
Updates Cargo.toml
creates both github release and tag
!!! Safe to use as actually performing an operation requires the --execute flag
Avoid inconsistent states by making operations as atomic as possible, leveraging gitoxide technology to the fullest
avoid bumping versions if the current version isn't released, allowing you to control the version by editing the cargo manifest
automatically adjust manifest versions and update manifests of crates which use those whose versions were incremented
create changelogs non-destructively, along with annotated tags and GitHub releases
Plays well with cargo release
See your release notes via in-repository tag objects and in GitHub Releases
but that one uses cargo-changelog instead of cargo-cliff
for workspaces
cargo changelog writes changelogs non-destructively, and only that, leaving the release workflow to cargo-release
& git-cliff for changelogs
& cargo-changelog !?
# Oxide-specific
Maybe CARGO_REGISTRY_TOKEN
Maybe "Oxide Releaser Bot" GH account
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment