Skip to content

Commit

Permalink
add goreleaser config
Browse files Browse the repository at this point in the history
although we publish debs on pkg.cloudflare.com, this is mostly handy for
generating the release notes automatically + creating the release, and
has the added benefit of adding curl-freindly binary downloads for macOS
+ linux
  • Loading branch information
nickysemenza committed Mar 17, 2021
1 parent 87d9804 commit 18a5af6
Show file tree
Hide file tree
Showing 3 changed files with 49 additions and 0 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
build/
/gokeyless
*.swp
dist/
37 changes: 37 additions & 0 deletions .goreleaser.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
env:
- GO111MODULE=on
- CGO_ENABLED=1
- GOFLAGS=-mod=vendor
- GOPROXY=off
builds:
- id: gokeyless-darwin
binary: gokeyless
env:
- CC=o64-clang
- CXX=o64-clang++
goos:
- darwin
goarch:
- amd64
main: ./cmd/gokeyless
ldflags:
- -s -w -X main.version={{.Version}}
- id: gokeyless-linux
binary: gokeyless
goos:
- linux
goarch:
- amd64
main: ./cmd/gokeyless
ldflags:
- -s -w -X main.version={{.Version}}
- -linkmode external -extldflags "-static"
archives:
- format: binary
release:
github:
owner: cloudflare
name: gokeyless
prerelease: auto
changelog:
sort: asc
11 changes: 11 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -110,3 +110,14 @@ test-trust: gokeyless
.PHONY: benchmark-softhsm
benchmark-softhsm:
go test -tags pkcs11 -v -race ./server -bench HSM -args -softhsm2

# GORELEASER_GITHUB_TOKEN=X make release-github
# token from https://github.com/settings/tokens/new
.PHONY: release-github
release-github:
docker run --rm --privileged -v $(PWD):/go/tmp \
-v /var/run/docker.sock:/var/run/docker.sock \
-w /go/tmp \
--env GORELEASER_GITHUB_TOKEN \
neilotoole/xcgo:latest goreleaser --rm-dist

0 comments on commit 18a5af6

Please # to comment.