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 tagging automation for crates #7144

Closed
wants to merge 3 commits into from
Closed

Add tagging automation for crates #7144

wants to merge 3 commits into from

Conversation

buffalojoec
Copy link
Contributor

Problem

Whenever we increment versions for crates in SPL, we have to remember to manually create tags for these new packages on the repository, and commit those tags to the remote. It would be nice if this was just a part of CI.

Summary of Changes

Add two new scripts and a GitHub action:

  • ci/detect-changed-manifests.sh: Detects changes to a manifest's version and returns a list of all manifests whose version changed.
  • ci/tag-releases.sh: Creates a new Git tag for each changed manifest.
  • workflows/release.yml: Workflow for master to create new tags and commit them to the repository whenever manifest versions change in a merged PR.

@buffalojoec buffalojoec requested a review from joncinque August 13, 2024 21:56
@buffalojoec buffalojoec changed the title Add some release automation for crates Add tagging automation for crates Aug 13, 2024
@buffalojoec
Copy link
Contributor Author

@joncinque The next step after this change would be to roll something similar to the monorepo's order-crates-for-publishing.py and use it in the release.yml workflow to not only tag the repo but also publish the crate. If we wanted to get even more interesting, we could add automation to publish releases via GitHub's API as well.

Let me know how far you want to go with this effort!

Copy link
Contributor

@joncinque joncinque left a comment

Choose a reason for hiding this comment

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

I'm not sure we should be automatically tagging as soon as a crate is bumped. If we accidentally bump too early or anything like that, then we can get into a bad situation.

If we do some automation for publishing, it would be nice to have something similar to the counter shank example at https://github.com/solana-program/counter-shank/blob/main/.github/workflows/publish-rust-client.yml and https://github.com/solana-program/counter-shank/blob/main/scripts/client/publish-rust.mjs

I need to test and see how cargo release handles cargo workspaces, but it would be really neat to have a manually triggered workflow that:

  • bumps the version everywhere (specified as a workflow parameter)
  • runs fmt / clippy / tests / dry-run-publish to make sure it's ok
  • creates the tag and pushes it
  • creates a GitHub release on that tag
  • publishes the crate to crates.io

And we could use this type of automation for the SDK monorepo. What do you think?

@buffalojoec
Copy link
Contributor Author

I just tested cargo release and it seems to work fine in our workspace. I hadn't looked at these publish scripts nor cargo release before. Looks like everything I've PR'ed here and in #7142 is covered by them.

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