name: Go

on:
    push:
        tags: [ '**' ]
    pull_request:
        tags: [ '**' ]
jobs:
    build:
        runs-on: ubuntu-latest
        steps:
            - uses: actions/checkout@v2

            - name: Set up Go
              uses: actions/setup-go@v2
              with:
                  go-version: 1.16

            - name: Build
              run: make build

            - name: Release
              uses: fnkr/github-action-ghr@v1
              if: startsWith(github.ref, 'refs/tags/')
              env:
                  GHR_COMPRESS: gz
                  GHR_PATH: /home/runner/work/powerproto/powerproto/dist/
                  GITHUB_TOKEN: ${{ secrets.ACTIONS_SECRET }}