viam-rust-utils 0.6.1

Utilities designed for use with Viamrobotics's SDKs
Documentation
name: Publish to crates.io

on:
  release:
    types: [published]

jobs:
  publish:
    if: github.repository_owner == 'viamrobotics'
    runs-on: ubuntu-latest

    steps:
      - name: Check if organization member
        id: is_organization_member
        if: github.event_name == 'workflow_dispatch'
        uses: jamessingleton/is-organization-member@1.0.1
        with:
          organization: viamrobotics
          username: ${{ github.actor }}
          token:  ${{ secrets.GITHUB_TOKEN }}

      - name: cancelling
        uses: andymckay/cancel-action@0.2
        if: |
          github.event_name == 'workflow_dispatch' && steps.is_organization_member.outputs.result == 'false'

      - uses: actions/checkout@v4

      - name: Setup rust toolchain
        uses: dtolnay/rust-toolchain@stable
        with:
          toolchain: stable

      - name: Publish
        uses: katyo/publish-crates@v2
        with:
          registry-token: ${{ secrets.CRATES_API_TOKEN }}