on:
  push:
    tags:
      - '*'

name: Release

jobs:
  publish:
    name: Release for ${{ matrix.os }}
    runs-on: ${{ matrix.os }}
    strategy:
      matrix:
        name: [
          linux,
          windows
        ]

        include:
          - name: linux
            os: ubuntu-latest
            artifact_name: target/release/genee
            asset_name: genee_linux
          - name: windows
            os: windows-latest
            artifact_name: target/release/genee.exe
            asset_name: genee_windows.exe
    
    steps:
      - uses: actions/checkout@v1
      - uses: actions-rs/toolchain@v1
        with:
          profile: minimal
          toolchain: stable
      - name: Build
        run: cargo build --release --locked
      - name: Upload binaries to release
        uses: svenstaro/upload-release-action@v2
        with:
          repo_token: ${{ secrets.GITHUB_TOKEN }}
          file: ${{ matrix.artifact_name }}
          asset_name: ${{ matrix.asset_name }}
          tag: ${{ github.ref }}
