From 840b72950f3124c52d462ab2e57262c7912a8749 Mon Sep 17 00:00:00 2001 From: Benjamin Muschko Date: Sat, 17 Aug 2024 14:29:38 -0600 Subject: [PATCH] Add GitHub Action workflow --- .github/workflows/build-publish.yml | 30 +++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 .github/workflows/build-publish.yml diff --git a/.github/workflows/build-publish.yml b/.github/workflows/build-publish.yml new file mode 100644 index 0000000..3e3e802 --- /dev/null +++ b/.github/workflows/build-publish.yml @@ -0,0 +1,30 @@ +name: Build and Publish +on: [push] +permissions: + contents: write +jobs: + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: Setup Go + uses: actions/setup-go@v5 + with: + go-version: 1.23.x + - name: Build + run: go build + - name: Test + run: go test ./... -coverprofile=coverage.txt -covermode=count + - name: Code Quality Analysis + uses: golangci/golangci-lint-action@v6 + with: + version: v1.59 + - name: Release + if: startsWith(github.ref, 'refs/tags/') + uses: goreleaser/goreleaser-action@v6 + with: + distribution: goreleaser + version: v2.2.0 + args: release --clean + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}