Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 14 additions & 1 deletion .github/workflows/publish-rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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: |
Expand Down
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion clients/rust/Cargo.toml
Original file line number Diff line number Diff line change
@@ -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 }
Expand Down
Loading