ci: enable crates.io publishing; reclaim togl crate for the CLI#40
Merged
Conversation
The release pipeline only ships GitHub binaries, so crates.io has been stuck at `togl` 0.2.3 (published before the toggle-*→togl-* crate rename). This wires up crate publishing again. - Rename the CLI package `togl-cli` → `togl` (directory unchanged; binaries stay `toggle`/`togl`). Continues the existing `togl` line so `cargo install togl` works, as the README already advertises. - Add a `version` to the `togl-lib` dep/dev-dep (required for publishing). - Mark `togl-ffi` `publish = false` (it's the libtogl C library, not a Rust dependency). - Add a `publish-crates` job to release.yml: on a release tag it syncs the togl-lib dep version to the tag, then publishes `togl-lib` and `togl` (in order) with CARGO_REGISTRY_TOKEN. - Update the `-p togl-cli` references in nix/togl.nix and the shell test script. Verified: full test suite + `nix build .#togl` green after the rename; `cargo publish --dry-run` clean for togl-lib (togl manifest validated; its full dry-run is gated only on togl-lib not yet being on crates.io, resolved by the publish ordering). actionlint clean. Refs P11. First publish fires on the next release tag once CARGO_REGISTRY_TOKEN is added.
There was a problem hiding this comment.
Pull request overview
Resumes crates.io publishing by reclaiming the togl crate name for the CLI package and adding an automated publish job to the release workflow. The CLI package (still under crates/togl-cli/) is renamed togl-cli → togl, while binaries (toggle, togl) and the directory are unchanged.
Changes:
- Rename CLI package to
togl, addversionto thetogl-libpath dep (required bycargo publish), and marktogl-ffiaspublish = false. - Add a
publish-cratesjob torelease.ymlthat syncs thetogl-libdep version to the release tag, then publishestogl-libfollowed bytogl. - Update
-p togl-clireferences innix/togl.nixandtests/test_simple_python.sh; updateCargo.lockandPROJECTS.md.
Reviewed changes
Copilot reviewed 6 out of 7 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| crates/togl-cli/Cargo.toml | Rename package to togl; add version = "0.5.0" to togl-lib dep/dev-dep. |
| crates/togl-ffi/Cargo.toml | Set publish = false with explanatory comment. |
| Cargo.lock | Reflect package rename togl-cli → togl. |
| nix/togl.nix | Switch cargoBuildFlags/cargoTestFlags to -p togl. |
| tests/test_simple_python.sh | Update cargo run -p togl-cli → -p togl. |
| .github/workflows/release.yml | Add publish-crates job: token check, sed-based dep-version sync, publish togl-lib then togl. |
| PROJECTS.md | Document Project P11 (crates.io publishing v0.6.0). |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This file contains hidden or 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
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.
Closes the crates.io gap (stuck at
togl0.2.3 — the pipeline only shipped GitHub binaries).What
togl: rename the CLI packagetogl-cli→togl(directory unchanged; binaries staytoggle/togl). Continues the existingtoglline socargo install toglworks (already in the README).versionto thetogl-libdep/dev-dep; marktogl-ffipublish = false(it's the libtogl C library, not a Rust dep).publish-cratesjob inrelease.yml: on a release tag, sync thetogl-libdep version to the tag, then publishtogl-libthentogl(cargo waits for the dep to land).-p togl-clirefs innix/togl.nix+ the shell test script.Why these were needed (not just a release.yml line)
togl0.2.3 predates the crate rename, so no workspace member was namedtoglanymore.cargo publishrefuses path-only deps —togl-libneeded aversion.Verified
nix build .#toglgreen after the rename.cargo publish --dry-runclean fortogl-lib;toglmanifest validated (its full dry-run is gated only ontogl-libnot yet being on crates.io — resolved by publish ordering).togl-lib, notclap).Note — does NOT affect nixpkgs PR #526149
That derivation builds the v0.5.0 tagged source, which still has
togl-cli. The rename ships in v0.6.0; the nixpkgs bump will pick up-p toglthen.Maintainer step before it works
Add repo secret
CARGO_REGISTRY_TOKEN(crates.io API token). Until then the publish job fails loudly but does not block the binary build. First publish fires on the next release tag.