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

Automate updating/publishing #18

Open
9 tasks
aDotInTheVoid opened this issue Sep 8, 2022 · 4 comments
Open
9 tasks

Automate updating/publishing #18

aDotInTheVoid opened this issue Sep 8, 2022 · 4 comments

Comments

@aDotInTheVoid
Copy link
Member

Part 1: Automatically generate changes with GHA

  • Detect changes in src/rustdoc-json-types
  • Decide if this is a major or minor version (FORMAT_VERSION should be a decent proxy, but may not be true if JSON format doesn't change but rust does)
  • Run ./update.sh
  • Update Cargo.toml
  • Update CHANGELOG.md
  • Create PR.

Part 2: Automaticly publish to Crates.io

  • Detect new version has been merged
  • Publish to crates.io
  • Do this in a way giving a way with minimal perms.

Overall, I don't think I wan't to automaticly publish on upstream changes, but it would be nice for it to be more automated

@aDotInTheVoid
Copy link
Member Author

https://github.com/matklad/always-assert/blob/master/xtask/src/main.rs does auto-publish on CI, and could be used as a starting point.

@Enselic
Copy link
Member

Enselic commented Apr 15, 2023

FWIW, here is the release action I use for rustdoc-json: https://github.com/Enselic/cargo-public-api/blob/main/.github/workflows/Release-rustdoc-json.yml. It also pushes a git tag after cargo publish.

Good to know: If you add a GitHub org as crates.io crate owner, its members are allowed to publish crates but not remove other crates.io owners. That is a good safety mechanism in in case the crates.io token leaks. A regular crates.io token allows to remove the original crate owner if it leaks. More info on GitHub org owners: https://doc.rust-lang.org/cargo/reference/publishing.html

@aDotInTheVoid
Copy link
Member Author

Further evidence this is worth doing: rust-lang/rust#109410 merged 4 days ago, but 933c7f0 was only released today. Historically this hasn't happened because I've been on top of things, but if rust has taught us anything, "just always be on top of things" is never a viable strategy in the long run.

@aDotInTheVoid
Copy link
Member Author

And in regards to token security, the new crates.io scoped token system makes this much less of a problem

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

2 participants