diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml new file mode 100644 index 0000000..3c860e8 --- /dev/null +++ b/.github/workflows/go.yml @@ -0,0 +1,35 @@ +name: Go + +on: + push: + branches: [ "main" ] + pull_request: + branches: [ "main" ] + +jobs: + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + - name: Set up Go + uses: actions/setup-go@v5 + with: + go-version: stable + + - name: Build + run: | + go generate -v . + go build -v . + + - name: Test + run: go test -v . + + - name: Run GoReleaser + uses: goreleaser/goreleaser-action@v6 + if: startsWith(github.ref, 'refs/tags/') + with: + version: '~> v2' + args: release --clean + env: + GITHUB_TOKEN: ${{ secrets.GORELEASER_TOKEN }}