name: Tagged Release

on:
  push:
    tags:
      - "v*"

jobs:
  github-release:
    name: GitHub Release
    runs-on: ubuntu-latest

    steps:
      - uses: actions/checkout@v2
      - uses: marvinpinto/action-automatic-releases@latest
        with:
          repo_token: ${{ secrets.GITHUB_TOKEN }}
          prerelease: false
          files: |
            LICENSE.md

  aur:
    name: AUR
    runs-on: ubuntu-latest

    steps:
      - uses: actions/checkout@v2
      - uses: KSXGitHub/github-actions-deploy-aur@v2.2.3
        with:
          pkgname: ttyper
          pkgbuild: ./PKGBUILD
          commit_username: ${{ secrets.AUR_USERNAME }}
          commit_email: ${{ secrets.AUR_EMAIL }}
          ssh_private_key: ${{ secrets.AUR_SSH_PRIVATE_KEY }}
          ssh_keyscan_types: rsa,dsa,ecdsa,ed25519
