name: Release

on:
  push:
    tags: 
    - '*'

jobs:
  call-build:
    uses: ./.github/workflows/build.yml

  release:
    runs-on: windows-latest
    needs: call-build
    steps:
    - name: Checkout
      uses: actions/checkout@v2
      with:
        fetch-depth: 0
    - name: Download artifacts
      uses: actions/download-artifact@v3
      with:
        name: installer
    - name: Create Release
      uses: ncipollo/release-action@v1.7.3
      with:
        artifacts: ./AmagnoPrinterInstaller.msi
        token: ${{ secrets.GITHUB_TOKEN }}
