Skip to content

Commit b8a114e

Browse files
committed
Add GoReleaser config file
Signed-off-by: Marko Mudrinić <[email protected]>
1 parent d37eeae commit b8a114e

File tree

4 files changed

+30
-0
lines changed

4 files changed

+30
-0
lines changed

.github/workflows/release.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,9 @@ jobs:
3131

3232
- name: Delete non-semver tags
3333
run: 'git tag -d $(git tag -l | grep -v "^v")'
34+
35+
- name: Set LDFLAGS
36+
run: echo LDFLAGS="$(make ldflags)" >> $GITHUB_ENV
3437

3538
- name: Run GoReleaser on tag
3639
if: github.event_name != 'pull_request'

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
/_build/
2+
/dist/
23
/_tools/
34
/vendor/
45
/.kcp.e2e/

.goreleaser.yaml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
builds:
2+
- id: "api-syncagent"
3+
main: ./cmd/api-syncagent
4+
binary: api-syncagent
5+
ldflags:
6+
- "{{ .Env.LDFLAGS }}"
7+
goos:
8+
- linux
9+
- darwin
10+
goarch:
11+
- amd64
12+
- arm64
13+
env:
14+
- CGO_ENABLED=0
15+
16+
archives:
17+
- id: api-syncagent
18+
builds:
19+
- api-syncagent
20+
21+
release:
22+
draft: true
23+
mode: keep-existing

Makefile

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,9 @@ GOOS ?= $(shell go env GOOS)
3030
.PHONY: all
3131
all: build test
3232

33+
ldflags:
34+
@echo $(LDFLAGS)
35+
3336
.PHONY: build
3437
build: $(CMD)
3538

0 commit comments

Comments
 (0)