name: Publish Helius SDK Crate

on:
  release:
    types: [published]
  workflow_dispatch:

jobs:
  manual-job:
    runs-on: ubuntu-latest
    steps:
      - name: Check out repository code
        uses: actions/checkout@v4
      
      - name: Setup Rust environment
        uses: actions-rs/toolchain@v1
        with:
          toolchain: stable
          default: true
          profile: minimal
      
      - name: Publish to crates.io
        uses: actions-rs/cargo@v1
        with:
          command: publish
          args: --token ${{ secrets.CRATES_IO_TOKEN }}
        env:
          CARGO_REGISTRY_TOKEN: ${{ secrets.CRATES_IO_TOKEN }}