name: Publish

on:
    push:
        tags: ["v*.*.*"]

env:
    CARGO_TERM_COLOR: always

jobs:
    publish:

        runs-on: ubuntu-latest

        steps:
        - uses: actions/checkout@v4
        - name: Publish cargo package
          env:
            CARGO_ACCESS_TOKEN: ${{ secrets.CARGO_ACCESS_TOKEN }}
          run: |
            cargo login "$CARGO_ACCESS_TOKEN"
            cargo publish --allow-dirty
        
