name: Rust - Publish to Crates.io

on: 
  release:
    types: [created]

jobs:
  build:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v2
      - uses: actions-rs/toolchain@v1
        with:
          toolchain: stable
      - run: cargo build --release --all-features
      - run: cargo publish --token ${{ secrets.CARGO_TOKEN }}
