rusty_mujoco 0.3.0

Rust bindings for the MuJoCo physics simulator
Documentation
name: Publish

on:
  push:
    tags: ['v*']

jobs:
  publish:
    runs-on: ubuntu-latest
    
    environment:
      name: publishing
      
    permissions:
      contents: write # for creating GitHub Release
      id-token: write # for OIDC authentication
    
    steps:
      - uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
        with:
          ref: main
          fetch-depth: 0
      
      - name: Ensure main branch
        run: |
          BRANCHS=$(git branch --contains ${{ github.ref_name }})
          set -- $BRANCHS
          for BRANCH in $BRANCHS; do
            if [[ "$BRANCH" == "main" ]]; then
              exit 0
            fi
          done
          exit 1
      
      - uses: rust-lang/crates-io-auth-action@b7e9a28eded4986ec6b1fa40eeee8f8f165559ec # v1.0.3
        id: cratesio_auth
      
      - name: Trusted Publish to crates.io
        env:
          CARGO_REGISTRY_TOKEN: ${{ steps.cratesio_auth.outputs.token }}
        run: |
          cargo publish --package rusty_mujoco --no-verify

      - name: Create GitHub Release
        env:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
        run: |
          gh release create ${{ github.ref_name }} --generate-notes