15eaa15a0e
* Upgrade to the official golangci-lint action and fix some issues it found * Update deps * Remove a shadow warning * Initialize the splitPattern only once * Initial attempt at supporting $GITHUB_ENV Needs some polishing and tests * Now it's actually working * Replace golang.org/x/crypto/ssh/terminal with golang.org/x/term * Disable the issue-228 test again * The linter is picky * Discovered that the workflow/envs.txt had to exist in certain cases * Fix small linter issue
65 lines
1.4 KiB
YAML
65 lines
1.4 KiB
YAML
name: push
|
|
on: [push, pull_request]
|
|
|
|
jobs:
|
|
lint:
|
|
name: Lint
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v2
|
|
- uses: golangci/golangci-lint-action@v2
|
|
env:
|
|
CGO_ENABLED: 0
|
|
with:
|
|
version: v1.32.2
|
|
|
|
test:
|
|
name: Test
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v2
|
|
- uses: actions/setup-go@v1
|
|
with:
|
|
go-version: 1.14
|
|
- run: go test -cover ./...
|
|
env:
|
|
CGO_ENABLED: 0
|
|
|
|
snapshot:
|
|
name: Snapshot
|
|
if: ${{ github.event_name == 'pull_request' }}
|
|
needs:
|
|
- lint
|
|
- test
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v2
|
|
- name: GoReleaser
|
|
uses: goreleaser/goreleaser-action@v2
|
|
with:
|
|
version: latest
|
|
args: release --snapshot --rm-dist
|
|
env:
|
|
SNAPSHOT_VERSION: "v0.0.0"
|
|
|
|
release:
|
|
name: Release
|
|
if: startsWith(github.ref, 'refs/tags/v')
|
|
needs:
|
|
- 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 }}
|
|
- name: Chocolatey
|
|
uses: ./.github/actions/choco
|
|
with:
|
|
version: ${{ github.ref }}
|
|
apiKey: ${{ secrets.CHOCO_APIKEY }}
|