name: Release

on:
  push:
    # Sequence of patterns matched against refs/tags
    tags:
      - 'v*' # Push events to matching v*, i.e. v1.0, v20.15.10

env:
  CARGO_TERM_COLOR: always

jobs:

  release:
    name: Build and release OS-X
    runs-on: ubuntu-latest

    steps:
      - name: Checkout
        uses: actions/checkout@v2
      - name: Publish to crates.io
        env:
          CARGO_TOKEN: ${{ secrets.CRATES_IO_TOKEN }}
        run: |
          cargo publish --token "${CARGO_TOKEN}"