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

add release workflow #658

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

Conversation

g-plane
Copy link

@g-plane g-plane commented Jan 17, 2025

This PR adds a GitHub Actions workflow for publishing crate to crates.io.

Once merged this PR, remember to :

  1. Go to crates.io and generate a token.
  2. Open repository settings on GitHub.
  3. Select the "Actions" under the "Secrets and variables":
    image
  4. Create a repository secret called CARGO_REGISTRY_TOKEN and paste the token into there.

To publish a new version to crates.io, just update the version field of Cargo.toml and create a corresponding Git tag.

Hope it helps. I'm looking forward to new versions of Salsa.

Copy link

netlify bot commented Jan 17, 2025

Deploy Preview for salsa-rs canceled.

Name Link
🔨 Latest commit 7181a3e
🔍 Latest deploy log https://app.netlify.com/sites/salsa-rs/deploys/678a283fb023d000092579e8

@MichaReiser
Copy link
Contributor

Thanks; this is great. Would you mind extending the README with a Contributing section that explains how to make a release?

@g-plane
Copy link
Author

g-plane commented Jan 17, 2025

Done.

@nikomatsakis
Copy link
Member

Ooh, this is awesome, thanks!

Copy link
Member

@nikomatsakis nikomatsakis left a comment

Choose a reason for hiding this comment

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

Thanks for this. It won't work as is though because publishing salsa requires publishing both salsa and salsa-macros. Also, the two step process (edit version(s), issue git tag) is maybe a bit more complex than I'd like.

My suggestion: let's create a cargo xtask like cargo publish-salsa and then modify it so that...

  • cargo publish-salsa with no arguments dumps some help
  • cargo publish-salsa prepare modifies Cargo.toml with new version and creates the git tag. It can also check that nothing is dirty in git. We should probably start maintaining release notes but that can wait.
  • cargo publish-salsa from-ci actually does the work. Ideally it should also assert that the tag has been pushed to main so we avoid publishing things that don't exist in main. But that can be a FIXME.

@g-plane
Copy link
Author

g-plane commented Jan 22, 2025

Are they always published in same versions?

You can also check cargo-release, so we don't need to create our own xtask.

@nikomatsakis
Copy link
Member

They are always in lockstep. Also I think there are now 3 crates.

https://github.com/release-plz/release-plz also looks neat -- probably there exist utilities for this by now.

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.

3 participants