From 51b2b779ac1aec154c1288ca54beca39bf1d7d11 Mon Sep 17 00:00:00 2001 From: Georgi Valkov Date: Wed, 30 Oct 2024 01:16:29 +0100 Subject: [PATCH] Add CI --- .github/workflows/go.yml | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 .github/workflows/go.yml 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 }}