name: Release
on:
  release: 
    types: [published]

jobs:
  crates_io:
    name: crates.io publish
    runs-on: ubuntu-latest
    steps:
      - name: checkout
        uses: actions/checkout@v2

      - name: toolchain
        uses: actions-rs/toolchain@v1
        with:
          toolchain: stable
          profile: minimal
          override: true

      - name: cargo publish
        run: cargo publish --token ${{ secrets.CRATES_IO_TOKEN }}
