From 33ff259abb68e43e31d7b51c23ec3572c31ff966 Mon Sep 17 00:00:00 2001 From: rsteube Date: Sun, 1 May 2022 16:09:06 +0200 Subject: [PATCH] added github actions --- .github/workflows/go.yml | 41 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 41 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..0524c4e --- /dev/null +++ b/.github/workflows/go.yml @@ -0,0 +1,41 @@ +name: Go + +on: + pull_request: + push: + +jobs: + + build: + runs-on: ubuntu-latest + steps: + - name: shallow clone + uses: actions/checkout@v2 + if: "!startsWith(github.ref, 'refs/tags/')" + + - name: deep clone + uses: actions/checkout@v2 + if: startsWith(github.ref, 'refs/tags/') + with: + fetch-depth: 0 + + - name: Set up Go + uses: actions/setup-go@v2 + with: + go-version: 1.17 + + - name: Build + run: go build -v ./... + + - name: Test + run: go test -v ./... + - + name: Run GoReleaser + uses: goreleaser/goreleaser-action@v2 + if: startsWith(github.ref, 'refs/tags/') + with: + version: latest + args: release --rm-dist + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + GORELEASER_GITHUB_TOKEN: ${{ secrets.GORELEASER_GITHUB_TOKEN }}