name: Publish to crates.io

on:
  release:
    types: [published]

jobs:
  publish:
    runs-on: ubuntu-latest
    steps:
    - uses: actions/checkout@v4
    - uses: Swatinem/rust-cache@v2
    - name: Install FUSE dependencies
      run: |
        sudo apt-get update
        sudo apt-get install -y libfuse3-dev
    - name: Publish
      run: cargo publish
      env:
        CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}
