DS-899 Implement V12 support for Rust (#52) #7
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Publish Chainlink Data Streams SDK Crate | |
| on: | |
| push: | |
| 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: | |
| runs-on: ubuntu-latest | |
| environment: publish | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v3 | |
| - name: Setup Rust | |
| uses: dtolnay/rust-toolchain@stable | |
| - name: Verify tag matches version | |
| run: | | |
| VERSION=$(grep '^version = "' rust/crates/sdk/Cargo.toml | cut -d '"' -f2) | |
| 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) != expected version ($TAG_VERSION)" | |
| exit 1 | |
| fi | |
| - name: Publish chainlink-data-streams-sdk | |
| run: | | |
| cd rust/crates/sdk | |
| cargo publish --token ${CARGO_DATA_STREAMS_SDK} | |
| if ! cargo owner --list | grep -q "github:smartcontractkit:RustCrates"; then | |
| cargo owner --add github:smartcontractkit:RustCrates | |
| fi | |
| env: | |
| CARGO_DATA_STREAMS_SDK: ${{ secrets.CARGO_DATA_STREAMS_SDK }} |