Skip to content

Commit

Permalink
use GoReleaser
Browse files Browse the repository at this point in the history
  • Loading branch information
mstrzele committed Oct 22, 2021
1 parent 02a6f91 commit 2d7abdd
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 1 deletion.
14 changes: 13 additions & 1 deletion .github/workflows/go.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,12 @@ name: Go
on:
push:
branches: [ master ]
tags:
- '*'
pull_request:
branches: [ master ]

jobs:

build:
runs-on: ubuntu-latest
steps:
Expand All @@ -25,6 +26,17 @@ jobs:

- name: Build
run: go build -v ./...
if: startsWith(github.ref, 'refs/heads/')

- name: Test
run: go test -v ./...
if: startsWith(github.ref, 'refs/heads/')

- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v2
if: startsWith(github.ref, 'refs/tags/')
with:
version: latest
args: release --rm-dist
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,5 @@
/Godeps/

# End of https://www.gitignore.io/api/go

dist/
13 changes: 13 additions & 0 deletions .goreleaser.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
before:
hooks:
- go mod tidy
builds:
- env:
- CGO_ENABLED=0
targets:
- linux_amd64
- windows_amd64
- darwin_amd64
- darwin_arm64
changelog:
skip: true

0 comments on commit 2d7abdd

Please sign in to comment.