2020-02-10 17:27:05 -06:00
|
|
|
name: push
|
2020-03-02 10:04:30 -06:00
|
|
|
on: [push, pull_request]
|
2020-02-10 17:27:05 -06:00
|
|
|
|
|
|
|
jobs:
|
2020-02-24 16:43:03 -06:00
|
|
|
lint:
|
2020-10-12 12:26:22 -05:00
|
|
|
name: Lint
|
2020-02-24 16:43:03 -06:00
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v2
|
2021-01-12 00:39:43 -06:00
|
|
|
- uses: golangci/golangci-lint-action@v2
|
2020-02-24 16:43:03 -06:00
|
|
|
env:
|
|
|
|
CGO_ENABLED: 0
|
2021-01-12 00:39:43 -06:00
|
|
|
with:
|
|
|
|
version: v1.32.2
|
2020-02-24 16:43:03 -06:00
|
|
|
|
|
|
|
test:
|
2020-10-12 12:26:22 -05:00
|
|
|
name: Test
|
2020-02-10 17:27:05 -06:00
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
2020-02-10 19:00:08 -06:00
|
|
|
- uses: actions/checkout@v2
|
2020-02-24 14:48:12 -06:00
|
|
|
- uses: actions/setup-go@v1
|
|
|
|
with:
|
2020-03-06 16:21:24 -06:00
|
|
|
go-version: 1.14
|
2020-02-24 14:48:12 -06:00
|
|
|
- run: go test -cover ./...
|
|
|
|
env:
|
|
|
|
CGO_ENABLED: 0
|
2020-02-24 17:04:33 -06:00
|
|
|
|
2020-08-30 00:55:22 -05:00
|
|
|
snapshot:
|
2020-10-12 12:26:22 -05:00
|
|
|
name: Snapshot
|
2020-08-30 00:55:22 -05:00
|
|
|
if: ${{ github.event_name == 'pull_request' }}
|
|
|
|
needs:
|
|
|
|
- lint
|
|
|
|
- test
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v2
|
|
|
|
- name: GoReleaser
|
2021-01-12 00:39:43 -06:00
|
|
|
uses: goreleaser/goreleaser-action@v2
|
2020-08-30 00:55:22 -05:00
|
|
|
with:
|
|
|
|
version: latest
|
|
|
|
args: release --snapshot --rm-dist
|
|
|
|
env:
|
|
|
|
SNAPSHOT_VERSION: "v0.0.0"
|
|
|
|
|
2020-02-24 17:04:33 -06:00
|
|
|
release:
|
2020-10-12 12:26:22 -05:00
|
|
|
name: Release
|
2020-02-24 17:05:41 -06:00
|
|
|
if: startsWith(github.ref, 'refs/tags/v')
|
2020-03-06 16:21:24 -06:00
|
|
|
needs:
|
2020-02-24 17:04:33 -06:00
|
|
|
- lint
|
|
|
|
- test
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v2
|
|
|
|
- name: GoReleaser
|
|
|
|
uses: goreleaser/goreleaser-action@v1
|
|
|
|
with:
|
|
|
|
version: latest
|
|
|
|
args: release --rm-dist
|
|
|
|
env:
|
|
|
|
GITHUB_TOKEN: ${{ secrets.GORELEASER_GITHUB_TOKEN }}
|
2020-03-09 19:49:55 -05:00
|
|
|
- name: Chocolatey
|
|
|
|
uses: ./.github/actions/choco
|
|
|
|
with:
|
|
|
|
version: ${{ github.ref }}
|
|
|
|
apiKey: ${{ secrets.CHOCO_APIKEY }}
|