Update go.yml

This commit is contained in:
Enrico Stahn 2020-03-04 15:59:37 +11:00 committed by GitHub
parent 9c6e0e0e07
commit ef3d502c4e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -7,13 +7,13 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Set up Go 1.14
- name: Set up Go
uses: actions/setup-go@v1
with:
go-version: 1.14
id: go
- name: Check out code into the Go module directory
- name: Checkout
uses: actions/checkout@v2
- name: Install golangci-lint
@ -33,8 +33,56 @@ jobs:
go-version: 1.14
id: go
- name: Check out code into the Go module directory
- name: Checkout
uses: actions/checkout@v2
- name: Test
run: go test ./...
tag:
name: Tag
runs-on: ubuntu-latest
needs: [lint, test]
if: github.ref == 'refs/heads/master'
steps:
- name: Setup Node.js for use with actions
uses: actions/setup-node@v1.1.0
- name: Checkout
uses: actions/checkout@v2
- name: Unshallow
run: git fetch --prune --unshallow
- name: Install semantic-release
run: yarn global add --no-progress --non-interactive "semantic-release" "@semantic-release/exec"
- name: Run semantic-release
run: $(yarn global bin)/semantic-release
release:
runs-on: ubuntu-latest
needs: [lint, test]
if: startsWith(github.ref, 'refs/tags/')
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Unshallow
run: git fetch --prune --unshallow
- name: Set up Go
uses: actions/setup-go@v1
with:
go-version: 1.14
id: go
- 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 }}