diff --git a/.github/workflows/publish-rust-report-crate.yml b/.github/workflows/publish-rust-report-crate.yml index 69fdf37..8db764d 100644 --- a/.github/workflows/publish-rust-report-crate.yml +++ b/.github/workflows/publish-rust-report-crate.yml @@ -5,6 +5,10 @@ on: tags: - "rust/chainlink-data-streams-report-v*" workflow_dispatch: # Keeping manual trigger as fallback + inputs: + version: + description: "Version to publish (e.g., 0.0.1)" + required: true jobs: publish: @@ -21,9 +25,13 @@ jobs: - name: Verify tag matches version run: | VERSION=$(grep '^version = "' rust/crates/report/Cargo.toml | cut -d '"' -f2) - TAG_VERSION=${GITHUB_REF#refs/tags/rust/chainlink-data-streams-report-v} + if [[ "${{ github.event_name }}" == "push" ]]; then + TAG_VERSION=${GITHUB_REF#refs/tags/rust/chainlink-data-streams-report-v} + else + TAG_VERSION=${{ github.event.inputs.version }} + fi if [ "$VERSION" != "$TAG_VERSION" ]; then - echo "Version mismatch: Cargo.toml ($VERSION) != tag ($TAG_VERSION)" + echo "Version mismatch: Cargo.toml ($VERSION) != expected version ($TAG_VERSION)" exit 1 fi diff --git a/.github/workflows/publish-rust-sdk-crate.yml b/.github/workflows/publish-rust-sdk-crate.yml index 3eda946..c5cc853 100644 --- a/.github/workflows/publish-rust-sdk-crate.yml +++ b/.github/workflows/publish-rust-sdk-crate.yml @@ -5,6 +5,10 @@ on: tags: - "rust/chainlink-data-streams-sdk-v*" workflow_dispatch: # Keeping manual trigger as fallback + inputs: + version: + description: "Version to publish (e.g., 0.0.1)" + required: true jobs: publish: @@ -21,9 +25,13 @@ jobs: - name: Verify tag matches version run: | VERSION=$(grep '^version = "' rust/crates/sdk/Cargo.toml | cut -d '"' -f2) - TAG_VERSION=${GITHUB_REF#refs/tags/rust/chainlink-data-streams-sdk-v} + if [[ "${{ github.event_name }}" == "push" ]]; then + TAG_VERSION=${GITHUB_REF#refs/tags/rust/chainlink-data-streams-sdk-v} + else + TAG_VERSION=${{ github.event.inputs.version }} + fi if [ "$VERSION" != "$TAG_VERSION" ]; then - echo "Version mismatch: Cargo.toml ($VERSION) != tag ($TAG_VERSION)" + echo "Version mismatch: Cargo.toml ($VERSION) != expected version ($TAG_VERSION)" exit 1 fi