Repository navigation
ci: replace unmaintained katyo/publish-crates with a native cargo publish step - #9635
daywalker90 wants to merge 1 commit into
Conversation
| run: | | ||
| set -euo pipefail | ||
| # Dependency order: each crate comes after the in-repo crates it depends on. | ||
| for dir in cln-rpc cln-grpc plugins lsps-types; do |
There was a problem hiding this comment.
the script publishes only if local > max(published). Suppose someone bumps an older line, cln-rpc 0.6.1 after 0.7.0 is out. that version is skipped silently with "already has an equal or newer version"?, but it was never published. maybe we can use smth like katyo/publish-crates, it checks whether the exact version exists? what do you think
There was a problem hiding this comment.
The whole point of this PR is to get rid of katyo/publish-crates. We have never gone back and published a patch version for an older "minor" version, not sure if we ever need that.
| set -euo pipefail | ||
| # Dependency order: each crate comes after the in-repo crates it depends on. | ||
| for dir in cln-rpc cln-grpc plugins lsps-types; do | ||
| metadata=$(cargo metadata --no-deps --format-version 1 --manifest-path "$dir/Cargo.toml") |
There was a problem hiding this comment.
do we need to check manifest_path?
maybe add
[ -n "$pkg" ] || { echo "no package found in $dir"; exit 1; }
There was a problem hiding this comment.
We need the manifest path for cargo publish and the package name might be non-existent in $dir, e.g. there is no cln-plugin directory, the directory is called plugins and the package cln-plugin.
The katyo/publish-crates action no longer publishes anything: the Release Rust workflow ran on the push that bumped lsps-types to 0.7.0 and did not publish it. The new step publishes each crate only when its Cargo.toml version is newer than the highest version on crates.io, in dependency order (cln-rpc, cln-grpc, cln-plugin, lsps-types). Cap the job at 30 minutes and give the crates.io index request a 30 second timeout so a hung network call cannot stall the release.
524da6e to
d0ba1e9
Compare
katyo/publish-crates no longer works. It should have published lsps-types 0.7.0 here: https://github.com/ElementsProject/lightning/actions/runs/39409322449.
The new step uses
cargo publishdirectly if a push is necessary (new version). It fails on any error so dependents are not left without the required dependency.Changelog-None