File tree Expand file tree Collapse file tree 4 files changed +48
-4
lines changed Expand file tree Collapse file tree 4 files changed +48
-4
lines changed Original file line number Diff line number Diff line change @@ -3,11 +3,11 @@ name: goreleaser
33on :
44 pull_request :
55 paths :
6- - .github/workflows/release.yml
7- - .goreleaser.yaml
6+ - .github/workflows/release.yml
7+ - .goreleaser.yaml
88 push :
99 tags :
10- - ' v*'
10+ - ' v*'
1111
1212permissions :
1313 contents : read
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'
5356 GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
5457
5558 - uses : actions/upload-artifact@v4
56- if : ${{ always() }}
59+ if : github.event_name == 'pull_request'
5760 with :
5861 name : binaries
5962 path : dist/*.tar.gz
Original file line number Diff line number Diff line change 11/_build /
2+ /dist /
23/_tools /
34/vendor /
45/.kcp.e2e /
Original file line number Diff line number Diff line change 1+ # Copyright 2025 The KCP Authors.
2+ #
3+ # Licensed under the Apache License, Version 2.0 (the "License");
4+ # you may not use this file except in compliance with the License.
5+ # You may obtain a copy of the License at
6+ #
7+ # http://www.apache.org/licenses/LICENSE-2.0
8+ #
9+ # Unless required by applicable law or agreed to in writing, software
10+ # distributed under the License is distributed on an "AS IS" BASIS,
11+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+ # See the License for the specific language governing permissions and
13+ # limitations under the License.
14+
15+ builds :
16+ - id : " api-syncagent"
17+ main : ./cmd/api-syncagent
18+ binary : api-syncagent
19+ ldflags :
20+ - " {{ .Env.LDFLAGS }}"
21+ goos :
22+ - linux
23+ - darwin
24+ goarch :
25+ - amd64
26+ - arm64
27+ env :
28+ - CGO_ENABLED=0
29+
30+ archives :
31+ - id : api-syncagent
32+ builds :
33+ - api-syncagent
34+
35+ release :
36+ draft : true
37+ mode : keep-existing
Original file line number Diff line number Diff line change @@ -30,6 +30,9 @@ GOOS ?= $(shell go env GOOS)
3030.PHONY : all
3131all : build test
3232
33+ ldflags :
34+ @echo $(LDFLAGS )
35+
3336.PHONY : build
3437build : $(CMD )
3538
You can’t perform that action at this time.
0 commit comments