-
Notifications
You must be signed in to change notification settings - Fork 138
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
ci: automate creation of GitHub releases and tags #2027
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #2027 +/- ##
=======================================
Coverage 75.63% 75.63%
=======================================
Files 155 155
Lines 15671 15676 +5
=======================================
+ Hits 11852 11857 +5
Misses 3819 3819 |
Does this do a dry-run publish to prevent cutting a release if the eventual publish will fail (e.g., because we failed to release some dependency in the workspace)? |
I imagine this will just do a github release draft publish like version.json workflow? I think @Stebalien is asking about doing a |
Yes, we can add this as a new job in the |
When you say this "automates the creation of tags" but doesn't automate the creation of E.g., what tags will I get if I update the version of |
Now, the introduced workflows will release packages defined by any of these
The workflows will also be triggered on changes to the root This is how we'll work out a version for a specific package:
As for the name of the package to use, we'll infer it as follows:
Now, let's say, we're trying to release package defined by
I also added a separator input to the release workflows and specified it here as Let me know if this meets your expectations now. |
I'm going to wait for us to resolve all the conversations on filecoin-project/actors-utils#235 first to avoid duplicating any work/discussions. |
I limited duplication here in 50273e3, similarly to changes requested in |
CONTRIBUTING.md
Outdated
@@ -78,7 +78,7 @@ Once the release is prepared, it'll go through a review: | |||
|
|||
Finally, an [FVM "owner"](https://github.com/orgs/filecoin-project/teams/fvm-crate-owners/members) will: | |||
|
|||
1. Merge the release PR to master. | |||
1. Merge the release PR to master (this will trigger GitHub release/tag creation if the workspace version in the root `Cargo.toml` was modified). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this complete? Are there steps from #2027 (comment) we need to include? I don't see discussion about opening a PR which creates a draft Release and that when we merge the PR we get a published Release.
And are the comments about an FVM owner still needing to run cargo publish
accurate? (or are we only doing a dryrun as part of CI?)
@Stebalien : I believe @galargh believes this is ready for review again. I am personally confused about whether crate publishing has been automated or not but that might be my own current mental state. I'm hopeful we get the readme updated to the new reality. |
#2031 should check the root crate. I think we need to match |
source: ${{ matrix.source }} | ||
run: | | ||
pushd "$(dirname $source)" | ||
cargo publish --dry-run |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this will fail because it won't publish in the right order.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I.e., if we cut a release of the sdk + shared at the same time (which we always do), we'd need to push a release of shared to some fake registry for the release of the sdk to pass a cargo publish
dry run (I think).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, I see what you mean now! Yes, that would definitely show up as a failure in the proposed process. Would it make sense to split the release in that case, as in, you first release shared
and only follow up with sdk
release after shared
is fully out?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's going to make releases take even longer, which defeats the point of having automation.
I think the answer here is manual dry-run and it's not going to be pretty.
- Figure out which crates need to be published.
- Either determine the correct order, or hard-code it in a config.
- Run
cargo vendor --versioned-dirs
, creating a.cargo/config.toml
file to respect the vendor directory. - In publish order (reverse dependency order):
- Run
cargo package
. - Copy the package (the extracted one) out of
target/packages
intovendor
. - Generate the
.cargo-checksum.json
file for that manually vendored package. This is the most annoying step, but shouldn't be hard withfind
+jq
...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is very helfpul, thank you. I included this in the improvements section of the release automation doc in a3fb5a9. I also described what happens inside the current state of the automation in more detail.
I think the big decision here is whether the partial automation would be useful here, or whether we should wait until we can fully handle cargo publish
es with respect to the dependency graph.
cc @BigLep
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for adding the docs. I'll leave for others to approve and make decisions here, but this still seems to me like it's moving the ball forward.
2. Check if a git tag for the version, using the `crate_name@version` as the pattern, already exists. Continue only if it does not. | ||
3. Create a draft GitHub release with the version as the tag. | ||
4. Comment on the pull request with a link to the draft release. | ||
5. Run `cargo publish --dry-run` for the crate for which the release is proposed. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it intentional that it's automated here but manual in actors-utils? https://github.com/filecoin-project/actors-utils/pull/235/files#diff-2b1b69303b927a484e02c7fad9fc87d0d3ff0dc22ae1da0ecd0dc935d922a23cR12
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It was explicitly requested here - that's why it was added. But it's not clear to me whether we want it at all without being able to incorporate dependency graph knowledge into the dry run publish process.
Co-authored-by: Steve Loeppky <[email protected]>
Per verbal with @Stebalien, without crate publishing we don't think this workflow is good enough to move forward. The reason is that in the manual workflow that a releaser like @Stebalien follows involves:
The workflow proposed in this PR has git tagging happening before any publishing has occurred and there are reasons why a dryrun publish is not truly representative (I'm not up on these details). As a result, this workflow could cause more work than before because you could be untagging in some cases. It's a bummer not to get this across the line, but I know IPDX's contract hours with FilOz are up at this point. As a result, I'm going to close this PR. For next network upgrade, nv24, if the situation hasn't improved, we'll have someone like @rjan90 or @BigLep watch @Stebalien and capture the manual steps that are covered so we at least document the current manual release process better. We'll also make sure that others have access to publish with filecoin-project/github-mgmt#58 landed. |
Sad to hear we couldn't get it over the line in this iteration, but I think these are totally fair points. I hope we'll be able to work on these together in the future and get the full automation in place for both this repo and |
Yeah, the lack of a a viable |
This automates the creation of GitHub releases and associated GitHub tags based on the changes to the version in the selected Cargo.toml files.
The automation uses the same principles as the one you might know from Go projects where we control the current version via version.json file (https://github.com/ipdxco/unified-github-workflows?tab=readme-ov-file#versioning). This is the exact same workflow just updated to work with Cargo.toml.
Note, that the automation doesn't take care of cargo publishing currently. It doesn't createcrate_name@crate_version
tags either. To handle these, I'd suggest creating another workflow triggered on tag creation or github release publishing, which creates additional tags and performs cargo publishing.The automation takes care of publishing
crate_name@crate_version
packages. It also creates GitHub releases for each tag.