aboutsummaryrefslogtreecommitdiff
path: root/.github/workflows/go-release-build.yml
diff options
context:
space:
mode:
Diffstat (limited to '.github/workflows/go-release-build.yml')
-rw-r--r--.github/workflows/go-release-build.yml45
1 files changed, 45 insertions, 0 deletions
diff --git a/.github/workflows/go-release-build.yml b/.github/workflows/go-release-build.yml
new file mode 100644
index 0000000..bc99dad
--- /dev/null
+++ b/.github/workflows/go-release-build.yml
@@ -0,0 +1,45 @@
+name: build
+
+on:
+ push:
+ branches:
+ - 'master'
+ tags:
+ - 'v*'
+
+jobs:
+ build:
+ runs-on: ubuntu-latest
+ steps:
+ -
+ name: Set up Go
+ uses: actions/setup-go@v2
+ with:
+ go-version: 1.15
+
+ -
+ name: Checkout
+ uses: actions/checkout@v2
+ with:
+ fetch-depth: 0
+
+ -
+ name: Tests
+ run: |
+ export GOPATH=/home/runner/go
+ mkdir -p $GOPATH/src/github.com/$GITHUB_ACTOR
+ mv $GITHUB_WORKSPACE $GOPATH/src/github.com/$GITHUB_ACTOR
+ ln -s $GOPATH/src/github.com/$GITHUB_REPOSITORY $GITHUB_WORKSPACE
+ # go mod tidy
+ go get -v ./...
+ go test -v ./...
+
+ -
+ name: Run GoReleaser
+ uses: goreleaser/goreleaser-action@v2
+ if: success() && startsWith(github.ref, 'refs/tags/')
+ with:
+ version: latest
+ args: release --rm-dist
+ env:
+ GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}