Skip to content

Commit 48e9c55

Browse files
committed
Add goreleaser
1 parent cbfe2cb commit 48e9c55

File tree

2 files changed

+36
-1
lines changed

2 files changed

+36
-1
lines changed

.goreleaser.yml

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
dist: dist
2+
builds:
3+
- main: ./main.go
4+
env:
5+
- CGO_ENABLED=1
6+
- GO111MODULE=on
7+
- GOFLAGS=-mod=vendor
8+
goos:
9+
- linux
10+
goarch:
11+
- amd64
12+
ldflags:
13+
- -w -s
14+
- -X "github.com/prometheus/common/version.Version={{ .Tag }}"
15+
- -X "github.com/prometheus/common/version.Revision={{ .Env.REVISION }}"
16+
- -X "github.com/prometheus/common/version.Branch={{ .Env.BRANCH }}"
17+
- -X "github.com/prometheus/common/version.BuildUser={{ .Env.USER }}"
18+
- -X "github.com/prometheus/common/version.BuildDate={{ .Env.BUILD_DATE }}"
19+
archives:
20+
- name_template: "{{ .ProjectName }}-{{ .Tag }}-{{ .Os }}-{{ .Arch }}"
21+
wrap_in_directory: false
22+
files:
23+
- LICENSE
24+
checksum:
25+
name_template: 'CHECKSUM'
26+
release:
27+
github:
28+
owner: grepplabs
29+
name: mqtt-proxy
30+
draft: true
31+
prerelease: auto

Makefile

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,4 +81,8 @@ release-setup:
8181
release-publish: release-setup
8282
@[ "${GITHUB_TOKEN}" ] && echo "releasing $(TAG)" || ( echo "GITHUB_TOKEN is not set"; exit 1 )
8383
git push origin $(TAG)
84-
$(ROOT_DIR)/bin/goreleaser release --rm-dist
84+
REVISION=$(REVISION) BRANCH=$(BRANCH) BUILD_DATE=$(BUILD_DATE) $(ROOT_DIR)/bin/goreleaser release --rm-dist
85+
86+
.PHONY: release-snapshot
87+
release-snapshot:
88+
REVISION=$(REVISION) BRANCH=$(BRANCH) BUILD_DATE=$(BUILD_DATE) $(ROOT_DIR)/bin/goreleaser --debug --rm-dist --snapshot --skip-publish

0 commit comments

Comments
 (0)