mirror of
https://github.com/SAP/jenkins-library.git
synced 2025-01-04 04:07:16 +02:00
Build go binary without debug symbols (#1618)
This produces a much smaller binary for faster downloads. See https://golang.org/cmd/link/ for docs on -s and -w flag.
This commit is contained in:
parent
c2de96ab43
commit
7fc9002ce1
5
.github/workflows/upload-go-master.yml
vendored
5
.github/workflows/upload-go-master.yml
vendored
@ -16,10 +16,13 @@ jobs:
|
||||
- env:
|
||||
CGO_ENABLED: 0
|
||||
run: |
|
||||
go build -ldflags "-X github.com/SAP/jenkins-library/cmd.GitCommit=${GITHUB_SHA} \
|
||||
# See https://golang.org/cmd/link/ for info on -w (omit the DWARF symbol table) and -s (omit the symbol table and debug information)
|
||||
# We use those flags to get a smaller compiled binary for faster downloads.
|
||||
go build -ldflags "-w -s -X github.com/SAP/jenkins-library/cmd.GitCommit=${GITHUB_SHA} \
|
||||
-X github.com/SAP/jenkins-library/pkg/log.LibraryRepository=${GITHUB_REPOSITORY} \
|
||||
-X github.com/SAP/jenkins-library/pkg/telemetry.LibraryRepository=https://github.com/${GITHUB_REPOSITORY}.git" \
|
||||
-o piper_master .
|
||||
stat --printf="File size of piper_master in bytes: %s\n" piper_master
|
||||
- uses: SAP/project-piper-action@master
|
||||
with:
|
||||
piper-version: master
|
||||
|
Loading…
Reference in New Issue
Block a user