diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml new file mode 100644 index 000000000..3dd5d726b --- /dev/null +++ b/.github/workflows/go.yml @@ -0,0 +1,46 @@ +name: Go + +on: [push, pull_request] + +jobs: + build: + name: Build + runs-on: ${{ matrix.os }} + strategy: + matrix: + go: [1.14, 1.x] + os: [ubuntu-latest, macos-latest, windows-latest] + steps: + - name: Setup Go + uses: actions/setup-go@v1 + with: + go-version: ${{ matrix.go }} + - name: Setup env + run: | + echo "::set-env name=GOPATH::$(go env GOPATH)" + echo "::add-path::$(go env GOPATH)/bin" + shell: bash + - name: Checkout + uses: actions/checkout@v2 + with: + fetch-depth: 1 + - name: Cache Go modules + uses: actions/cache@v1 + with: + path: ~/go/pkg/mod + key: ${{ runner.os }}-build-${{ hashFiles('**/go.sum') }} + restore-keys: | + ${{ runner.OS }}-build-${{ env.cache-name }}- + ${{ runner.OS }}-build- + ${{ runner.OS }}- + - name: Setup GolangCI-Lint + run: go get -u github.com/golangci/golangci-lint/cmd/golangci-lint + working-directory: ~ + - name: Lint + run: make lint + - name: Vet + run: make vet + - name: Build + run: make build + - name: Test + run: make test diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml new file mode 100644 index 000000000..7eb2e8fbb --- /dev/null +++ b/.github/workflows/release.yaml @@ -0,0 +1,27 @@ +name: Release + +on: + push: + branches-ignore: + - '**' + tags: + - 'v*.*.*' + +jobs: + goreleaser: + runs-on: ubuntu-latest + steps: + - name: Setup Go + uses: actions/setup-go@v1 + with: + go-version: 1.14 + - name: Checkout + uses: actions/checkout@v2 + - name: Run GoReleaser + uses: goreleaser/goreleaser-action@v1 + with: + version: latest + args: release --rm-dist + key: ${{ secrets.YOUR_PRIVATE_KEY }} + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}