aboutsummaryrefslogtreecommitdiff
path: root/.github/workflows/go-release-build.yml
diff options
context:
space:
mode:
authorTong Sun <[email protected]>2021-07-05 19:12:50 -0400
committerTong Sun <[email protected]>2021-07-05 19:12:50 -0400
commitaccdeb88fe26c676c22d278b637c3b4d2bbdd9bb (patch)
treed7c6ed9a905e255bf1e068e32788cdc30357af9d /.github/workflows/go-release-build.yml
parent- [+] add TableCompat plugin; enable Table (diff)
downloadhtml2md-237a800a4531eba8081aa64cd5d5c32ab2368bbf.tar.xz
html2md-237a800a4531eba8081aa64cd5d5c32ab2368bbf.zip
- [+] use GH actions for CD insteadv0.2.1
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 }}