Skip to content

Commit

Permalink
add goreleaser
Browse files Browse the repository at this point in the history
  • Loading branch information
a-wing committed Mar 31, 2022
1 parent 83359ac commit 64e3b4d
Show file tree
Hide file tree
Showing 3 changed files with 59 additions and 14 deletions.
14 changes: 0 additions & 14 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,17 +20,3 @@ jobs:
- name: Test
run: make test

- name: Build Releases
if: startsWith(github.ref, 'refs/tags/')
run: make releases

- name: Upload Release
uses: softprops/action-gh-release@v1
if: startsWith(github.ref, 'refs/tags/')
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
files: bin/*
draft: true
prerelease: true

31 changes: 31 additions & 0 deletions .github/workflows/goreleaser.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: goreleaser

on:
push:
tags:
- "v*"

jobs:
goreleaser:
runs-on: ubuntu-latest
steps:
-
name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 0
-
name: Set up Go
uses: actions/setup-go@v2
with:
go-version: 1.18
-
name: Run GoReleaser
uses: goreleaser/goreleaser-action@v2
with:
distribution: goreleaser
version: latest
args: release --rm-dist
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

28 changes: 28 additions & 0 deletions .goreleaser.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
builds:
- env:
- CGO_ENABLED=0
goos:
- linux
- windows
- darwin
ldflags:
- -s -w
- -X "sb.im/ncp/constant.Version={{.Version}}"
- -X "sb.im/ncp/constant.Commit={{.Commit}}"
- -X "sb.im/ncp/constant.BuildTime={{.Date}}"

checksum:
name_template: 'checksums.txt'
snapshot:
name_template: "{{ incpatch .Version }}-next"
changelog:
sort: asc
filters:
exclude:
- '^Merge'
- '^build'
- '^chore'
- '^docs'
- '^test'
- '^ci'

0 comments on commit 64e3b4d

Please sign in to comment.