From accdeb88fe26c676c22d278b637c3b4d2bbdd9bb Mon Sep 17 00:00:00 2001 From: Tong Sun Date: Mon, 5 Jul 2021 19:12:50 -0400 Subject: - [+] use GH actions for CD instead --- .github/workflows/go-release-build.yml | 45 ++++++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) create mode 100644 .github/workflows/go-release-build.yml (limited to '.github/workflows/go-release-build.yml') 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 }} -- cgit v1.2.3