name: Publish Rust package pyth-lazer-solana-contract to crates.io

on:
  push:
    tags:
      - rust-pyth-lazer-solana-contract-v*
jobs:
  publish-pyth-lazer-solana-contract:
    name: Publish Rust package pyth-lazer-solana-contract to crates.io
    runs-on: ubuntu-latest
    steps:
      - name: Checkout sources
        uses: actions/checkout@v2

      - run: cargo publish --token ${CARGO_REGISTRY_TOKEN}
        env:
          CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}
        working-directory: "lazer/contracts/solana/programs/pyth-lazer-solana-contract"
