-
Notifications
You must be signed in to change notification settings - Fork 39
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
Adding release stage #159
Adding release stage #159
Conversation
At the moment this Release cycle looks almost identical to the one proposed for embassy-rs/bt-hci#22. However there is a couple of questions that need to be clarified:
On the Crates.io side, according to the rust book we should handle the cargo.toml like so
[dependencies]
# Uses `my-bitflags` when used locally, and uses
# version 1.0 from crates.io when published.
bitflags = { path = "my-bitflags", version = "1.0" }
# Uses the given git repo when used locally, and uses
# version 1.0 from crates.io when published.
smallvec = { git = "https://github.com/servo/rust-smallvec.git", version = "1.0" }
# N.B. that if a version doesn't match, Cargo will fail to compile! |
I assume you're referring to
Yes, it should be run. Just running the test workflow should be enough.
This is for the crate consumer though, not for us? |
Ahh okay I think that makes sense, so each increment of this project would mean both crates increment at the same rate. So both projects have the same version number regardless of what code was updated? As for not releasing to crates.io, does that mean that crates.io would only have for example v0.1.0 for
Awesome! :)
I assumed it was for the publisher too? I know at the moment I cant run the --dry-run without specifying the trouble-host-macros crate, After specification it complains it doesn't exist which makes sense. If the version isn't in the toml it spits out an error like so: trouble/host on Add-ci-publish-workflow [!] is 📦 v0.1.0 via 🐍 v3.13.0 via 🦀 v1.82.0 on ☁️ (eu-north-1)
❯ cargo publish --dry-run
Updating crates.io index
error: all dependencies must have a version specified when publishing.
dependency `trouble-host-macros` does not specify a version
Note: The published dependency will use the version from crates.io,
the `path` specification will be removed from the dependency declaration. |
As for running the tests @lulf,
Since that runs on every PR, is this what you mean by should be enough? |
I'm thinking a la serde and serde-derive |
I thought some more about this, and I think we should tag them independently, it is a lot simpler:
Ah, I see. Yes, we should add a version there. |
For PRs, it is invoked by /test at present, and only for people added to the repo. But for GHA on release tags, it's ok to run the test workflow since only repo members can push tags. |
I believe this is now at a stage for merging the workflow is as follows: @lulf @jamessizeland
Current Issues that need to be resolved:
When merging, could we please squash the commits, due to the type of PR this is, it required a lot more commits than necessary |
/test |
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.
LGTM
/test |
Proposal for CI Publishing to crates.io
The following is a very simple solution to ticket #154 . It does not involve any changes to the existing CI infrastructure. It was based off a similar release cycle suggested for the BT-HCI repo/crate (embassy-rs/bt-hci#22)
How it Works
Whenever a new tag is made in the format VX.X.X, the release workflow will activate. It consists of two jobs.
build
: Which is identical to the tests,yml. Ensuring that every release runs our ci testsrelease
: This job will only run if the build job passes, It will first verify that the Github tag matches the config.toml tag. (Assumptions are made here, that both crates will increment their version at the same time) Only then will it continue on with the build process and then publish both a GitHub Release and crates.io release. All tags should match each other, allowing a single source of truth to be found.What Other options did I try
Testing
It does sucessfully publish crates to the staging crates.io https://staging.crates.io/crates/ci_playground. It was tested both in CI workflow and on terminal using the--dry-run
command.