github.com/Code-Hex/battery@v1.0.0/.github/workflows/main.yml (about)

     1  on:
     2    push:
     3      branches:
     4        - "master"
     5      tags:
     6        - "v*.*.*"
     7    pull_request:
     8  
     9  jobs:
    10    test:
    11      runs-on: ubuntu-latest
    12      steps:
    13      - uses: actions/checkout@v3
    14      - name: Setup go
    15        uses: actions/setup-go@v3
    16        with:
    17          go-version: '1.18'
    18      - name: Run GoReleaser Build Check
    19        uses: goreleaser/goreleaser-action@v2
    20        with:
    21          version: latest
    22          args: build --rm-dist --snapshot
    23      - name: Run GoReleaser
    24        if: contains(github.ref, 'tags/v')
    25        uses: goreleaser/goreleaser-action@v2
    26        with:
    27          version: latest
    28          args: release --rm-dist
    29        env:
    30          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
    31          HOMEBREW_TAP_GITHUB_TOKEN: ${{ secrets.HOMEBREW_TAP_GITHUB_TOKEN }}