Skip to content

Commit

Permalink
Update go build flags
Browse files Browse the repository at this point in the history
  • Loading branch information
ffurrer2 committed Oct 20, 2024
1 parent ac9c941 commit 3fe250d
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
3 changes: 3 additions & 0 deletions build/package/.goreleaser.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -87,10 +87,13 @@ builds:
command: build
ldflags:
- -X github.com/ffurrer2/semver/v2/internal/pkg/app.version={{.Version}}
- -extldflags "-static"
- -s
- -w
flags:
- -v
- -mod=readonly
- -trimpath
env:
- CGO_ENABLED=0

Expand Down
8 changes: 5 additions & 3 deletions tasks/GoTasks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@ vars:
GO_BUILD_ENV: CGO_ENABLED=0
LDFLAGS: >-
-X github.com/ffurrer2/semver/v2/internal/pkg/app.version={{.BUILD_VERSION}}
-s -w -extldflags "-static"
-extldflags "-static"
-s
-w
tasks:
clean:
Expand All @@ -33,7 +35,7 @@ tasks:
- task: download
- mkdir -p artifacts/bin
- |-
{{.GO_BUILD_ENV}} go build -o artifacts/bin -v -ldflags='{{.LDFLAGS}}' -mod=mod -trimpath ./cmd/semver
{{.GO_BUILD_ENV}} go build -o artifacts/bin -v -ldflags='{{.LDFLAGS}}' -mod=readonly -trimpath ./cmd/semver
silent: true

test:
Expand Down Expand Up @@ -84,7 +86,7 @@ tasks:
upgrade-indirect-dependencies:
desc: Upgrade all indirect dependencies
cmds:
- go get -d=true -v -u all
- go get -v -u all
- task: tidy
silent: true

Expand Down

0 comments on commit 3fe250d

Please sign in to comment.