Skip to content

Commit 923fb21

Browse files
authored
Add version input to publish workflows for manual triggering (#14)
1 parent 35aaa52 commit 923fb21

File tree

2 files changed

+20
-4
lines changed

2 files changed

+20
-4
lines changed

.github/workflows/publish-rust-report-crate.yml

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,10 @@ on:
55
tags:
66
- "rust/chainlink-data-streams-report-v*"
77
workflow_dispatch: # Keeping manual trigger as fallback
8+
inputs:
9+
version:
10+
description: "Version to publish (e.g., 0.0.1)"
11+
required: true
812

913
jobs:
1014
publish:
@@ -21,9 +25,13 @@ jobs:
2125
- name: Verify tag matches version
2226
run: |
2327
VERSION=$(grep '^version = "' rust/crates/report/Cargo.toml | cut -d '"' -f2)
24-
TAG_VERSION=${GITHUB_REF#refs/tags/rust/chainlink-data-streams-report-v}
28+
if [[ "${{ github.event_name }}" == "push" ]]; then
29+
TAG_VERSION=${GITHUB_REF#refs/tags/rust/chainlink-data-streams-report-v}
30+
else
31+
TAG_VERSION=${{ github.event.inputs.version }}
32+
fi
2533
if [ "$VERSION" != "$TAG_VERSION" ]; then
26-
echo "Version mismatch: Cargo.toml ($VERSION) != tag ($TAG_VERSION)"
34+
echo "Version mismatch: Cargo.toml ($VERSION) != expected version ($TAG_VERSION)"
2735
exit 1
2836
fi
2937

.github/workflows/publish-rust-sdk-crate.yml

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,10 @@ on:
55
tags:
66
- "rust/chainlink-data-streams-sdk-v*"
77
workflow_dispatch: # Keeping manual trigger as fallback
8+
inputs:
9+
version:
10+
description: "Version to publish (e.g., 0.0.1)"
11+
required: true
812

913
jobs:
1014
publish:
@@ -21,9 +25,13 @@ jobs:
2125
- name: Verify tag matches version
2226
run: |
2327
VERSION=$(grep '^version = "' rust/crates/sdk/Cargo.toml | cut -d '"' -f2)
24-
TAG_VERSION=${GITHUB_REF#refs/tags/rust/chainlink-data-streams-sdk-v}
28+
if [[ "${{ github.event_name }}" == "push" ]]; then
29+
TAG_VERSION=${GITHUB_REF#refs/tags/rust/chainlink-data-streams-sdk-v}
30+
else
31+
TAG_VERSION=${{ github.event.inputs.version }}
32+
fi
2533
if [ "$VERSION" != "$TAG_VERSION" ]; then
26-
echo "Version mismatch: Cargo.toml ($VERSION) != tag ($TAG_VERSION)"
34+
echo "Version mismatch: Cargo.toml ($VERSION) != expected version ($TAG_VERSION)"
2735
exit 1
2836
fi
2937

0 commit comments

Comments
 (0)