Skip to content

ci: replace unmaintained katyo/publish-crates with a native cargo publish step - #9635

Open
daywalker90 wants to merge 1 commit into
ElementsProject:masterfrom
daywalker90:ci/replace-publish-crates-action
Open

daywalker90 wants to merge 1 commit into
ElementsProject:masterfrom
daywalker90:ci/replace-publish-crates-action

Conversation

@daywalker90

Copy link
Copy Markdown
Collaborator

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 publish directly if a push is necessary (new version). It fails on any error so dependents are not left without the required dependency.

Changelog-None

@daywalker90
daywalker90 requested a review from Andezion October 20, 2026 11:41
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

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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")

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do we need to check manifest_path?
maybe add

            [ -n "$pkg" ] || { echo "no package found in $dir"; exit 1; }

@daywalker90 daywalker90 Oct 20, 2026 •

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread .github/workflows/crate-io.yml Outdated
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.
@daywalker90
daywalker90 force-pushed the ci/replace-publish-crates-action branch from 524da6e to d0ba1e9 Compare October 20, 2026 14:46

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants