name: Publish Pyth SDK for the Solana Receiver to crates.io

on:
  push:
    tags:
      - pyth-solana-receiver-sdk-v*
jobs:
  publish-pyth-solana-receiver-sdk:
    name: Publish Pyth SDK for the Solana Receiver
    runs-on: ubuntu-latest
    steps:
      - name: Checkout sources
        uses: actions/checkout@v2
      - uses: actions-rust-lang/setup-rust-toolchain@v1
      - run: cargo publish --token ${CARGO_REGISTRY_TOKEN}
        env:
          CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}
        working-directory: "target_chains/solana/pyth_solana_receiver_sdk"
