name: release
on:
  # Test that it works on pull_request; won't upload without GITHUB_TOKEN.
  pull_request:
  push:
    tags:
      - v*

jobs:
  goreleaser:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v2
        with:
          fetch-depth: 0
      - uses: actions/setup-go@v2
        with:
          go-version: '^1.x'
      - uses: actions/cache@v2
        id: cache
        with:
          path: |
            ~/go/pkg/mod              # Module download cache
            ~/.cache/go-build         # Build cache (Linux)
            ~/Library/Caches/go-build # Build cache (Mac)
            '%LocalAppData%\go-build' # Build cache (Windows)      
          key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
          restore-keys: |
            ${{ runner.os }}-go-
      - name: install deps
        if: steps.cache.output.cache-hit != 'true'
        run: make --debug install_deps
      - uses: goreleaser/goreleaser-action@v2
        with:
          version: latest
          args: release --rm-dist
        env:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

name: release
on:
  # Test that it works on pull_request; goreleaser goes into snapshot mode if not a tag.
  pull_request:
  push:
    tags:
      - v*

jobs:
  goreleaser:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v2
        with:
          fetch-depth: 0
      - uses: actions/setup-go@v2
        with:
          go-version: '^1.x'
      - uses: actions/cache@v2
        id: cache
        with:
          path: |
            ~/go/pkg/mod              # Module download cache
            ~/.cache/go-build         # Build cache (Linux)
            ~/Library/Caches/go-build # Build cache (Mac)
            '%LocalAppData%\go-build' # Build cache (Windows)      
          key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
          restore-keys: |
            ${{ runner.os }}-go-
      - name: install deps
        if: steps.cache.output.cache-hit != 'true'
        run: make --debug install_deps
      - uses: goreleaser/goreleaser-action@v2
        with:
          version: latest
          args: release --rm-dist
        env:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

Update comment with what really happened.
Update comment with what really happened.
