From 2225dcb5b30534c4beb5167a3ecc83b414c0e1c6 Mon Sep 17 00:00:00 2001 From: Jo D Date: Fri, 15 May 2026 12:02:18 -0400 Subject: [PATCH] ci: bump rust client publish version Publish Rust client v0.1.1 because subscriptions v0.1.0 already exists on crates.io. Read the subscriptions crate version explicitly and fail early when the target version is already published. --- .github/workflows/publish-rust.yml | 15 ++++++++++++++- Cargo.lock | 2 +- clients/rust/Cargo.toml | 2 +- 3 files changed, 16 insertions(+), 3 deletions(-) diff --git a/.github/workflows/publish-rust.yml b/.github/workflows/publish-rust.yml index 51298b8..750c70a 100644 --- a/.github/workflows/publish-rust.yml +++ b/.github/workflows/publish-rust.yml @@ -94,10 +94,23 @@ jobs: - name: Get current version id: version run: | - VERSION=$(cargo metadata --no-deps --format-version 1 | jq -r '.packages[0].version') + VERSION=$(cargo metadata --no-deps --format-version 1 | jq -r '.packages[] | select(.name == "subscriptions") | .version') + if [ -z "$VERSION" ]; then + echo "::error::Could not find subscriptions crate version" + exit 1 + fi echo "version=$VERSION" >> $GITHUB_OUTPUT echo "Publishing subscriptions v$VERSION" + - name: Check crates.io version availability + if: ${{ inputs.publish-to-crates }} + run: | + REGISTRY_CHECK_DIR="${RUNNER_TEMP:-/tmp}" + if (cd "$REGISTRY_CHECK_DIR" && cargo info "subscriptions@${{ steps.version.outputs.version }}" >/dev/null 2>&1); then + echo "::error::subscriptions v${{ steps.version.outputs.version }} already exists on crates.io. Bump clients/rust/Cargo.toml before publishing." + exit 1 + fi + - name: Check if prerelease id: prerelease run: | diff --git a/Cargo.lock b/Cargo.lock index e82286b..83ba403 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -5287,7 +5287,7 @@ checksum = "7da8b5736845d9f2fcb837ea5d9e2628564b3b043a70948a3f0b778838c5fb4f" [[package]] name = "subscriptions" -version = "0.1.0" +version = "0.1.1" dependencies = [ "borsh 1.6.0", "num-derive", diff --git a/clients/rust/Cargo.toml b/clients/rust/Cargo.toml index 801ecf8..48b6f43 100644 --- a/clients/rust/Cargo.toml +++ b/clients/rust/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "subscriptions" -version = "0.1.0" +version = "0.1.1" edition = "2021" description = "Rust client for the Subscriptions Solana program" license = { workspace = true }