-
Notifications
You must be signed in to change notification settings - Fork 893
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
Migrate release workflow to cargo-dist
#9559
Open
charliermarsh
wants to merge
2
commits into
main
Choose a base branch
from
charlie/cargo-dist-test
base: main
Could not load branches
Branch not found: {{ refName }}
Could not load tags
Nothing to show
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
+536
−239
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
charliermarsh
force-pushed
the
charlie/cargo-dist-test
branch
2 times, most recently
from
January 17, 2024 05:47
b368887
to
4f38fec
Compare
CodSpeed Performance ReportMerging #9559 will not alter performanceComparing Summary
|
charliermarsh
force-pushed
the
charlie/cargo-dist-test
branch
3 times, most recently
from
January 17, 2024 06:09
1592437
to
b2bf601
Compare
|
charliermarsh
force-pushed
the
charlie/cargo-dist-test
branch
from
January 17, 2024 16:12
43f9981
to
537bcd1
Compare
charliermarsh
commented
Jan 17, 2024
charliermarsh
commented
Jan 17, 2024
zanieb
reviewed
Jan 18, 2024
zanieb
reviewed
Jan 18, 2024
zanieb
reviewed
Jan 18, 2024
zanieb
reviewed
Jan 18, 2024
zanieb
reviewed
Jan 18, 2024
zanieb
approved these changes
Jan 18, 2024
konstin
approved these changes
Jan 18, 2024
charliermarsh
added a commit
to astral-sh/uv
that referenced
this pull request
Jan 18, 2024
## Summary This PR adds a release workflow powered by `cargo-dist`. It's similar to the version that's PR'd in Ruff (astral-sh/ruff#9559), with the exception that it doesn't include the Docker build or the "update dependents" step for pre-commit.
charliermarsh
force-pushed
the
charlie/cargo-dist-test
branch
2 times, most recently
from
February 8, 2024 14:52
4aa8349
to
4ec0a93
Compare
charliermarsh
force-pushed
the
charlie/cargo-dist-test
branch
from
February 8, 2024 17:13
4ec0a93
to
fe8c8c2
Compare
Inherit profile Update target list Slim down release for testing Set repo Wrap in dummy dir Prep for PR Add Docker and dependents jobs Move to post-announce Add more docs Temp: testing Split up docker Update names Update cargo dist Use OCI Use a single docker task Uncomment
charliermarsh
force-pushed
the
charlie/cargo-dist-test
branch
from
April 7, 2024 03:16
fe8c8c2
to
3cd6d03
Compare
charliermarsh
force-pushed
the
charlie/cargo-dist-test
branch
from
April 7, 2024 03:22
3cd6d03
to
8b2fe3c
Compare
I'm planning to ship this as part of Ruff v0.4.0 (i.e., in the next few weeks) given that it changes the archive format. |
charliermarsh
force-pushed
the
charlie/cargo-dist-test
branch
from
April 7, 2024 03:32
8b2fe3c
to
f54791f
Compare
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
This PR migrates our release workflow to
cargo-dist
. The primary motivation here is that we want to ship dedicated installers for Ruff that work across platforms, andcargo-dist
gives us those installers out-of-the-box. The secondary motivation is thatcargo-dist
formalizes some of the patterns that we've built up over time in our own release process.At a high level:
release.yml
file is generated bycargo-dist
withcargo dist generate
. It doesn't contain any modifications vis-a-vis the generated file. (If it's edited out of band from generation, the release fails.)cargo-dist
workflow. Specifically,build-binaries
builds the wheels and packages them into binaries (as onmain
), whilebuild-docker.yml
builds the Docker image.publish-pypi.yml
publishes the wheels to PyPI. This is effectively ourrelease.yaml
(onmain
), broken down into individual workflows rather than steps within a single workflow.Changes from
main
The workflow is nearly unchanged. We kick off a release manually via the GitHub Action by providing a tag. If the tag doesn't match the
Cargo.toml
, the release fails. If the tag matches an already-existing release, the release fails.The release proceeds by (in order):
cargo-dist
.ruff-pre-commit
(if it's not a "dry run").There are a few changes in the workflow as compared to
main
:There are also a few breaking changes for consumers of the binaries:
/latest
URLs on GitHub, and is part of the cargo-dist paradigm.--strip-components=1
when untarring.Here's an example release that I created -- I omitted all the artifacts since I was just testing a workflow, so none of the installers or links work, but it gives you a sense for what the release looks like: https://github.com/charliermarsh/cargodisttest/releases/tag/0.1.13.
Test Plan
I ran a successful release to completion last night, and installed Ruff via the installer:
The piece I'm least confident about is the Docker push. We build the image, but the push fails in my test repo since I haven't wired up the credentials.