File tree Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -88,12 +88,18 @@ jobs:
8888 - name : Set up additional flags
8989 if : ${{ matrix.container == 'core' }}
9090 # TODO: Proper versioning
91- run : echo "ADDITIONAL_GO_FLAGS=-ldflags=\"- X github.com/goharbor/harbor/src/lib/config.GitCommit=$(git rev-parse HEAD) -X github.com/goharbor/harbor/src/lib/config.ReleaseVersion=dev\" " >> $GITHUB_ENV
91+ run : echo "ADDITIONAL_GO_LDFLAGS=- X github.com/goharbor/harbor/src/lib/config.GitCommit=$(git rev-parse HEAD) -X github.com/goharbor/harbor/src/lib/config.ReleaseVersion=dev" >> $GITHUB_ENV
9292
9393 - name : Build binary
9494 if : ${{ matrix.build_binary != '' }}
9595 run : |
96- docker run --rm -v .:/harbor -w /harbor/src/${{ matrix.src_name || matrix.container}} golang:1.24.6 /usr/local/go/bin/go build -buildvcs=false -o /harbor/make/photon/${{ matrix.container }}/${{matrix.build_binary}} ${ADDITIONAL_GO_FLAGS:-}
96+ # If ADDITIONAL_GO_LDFLAGS is set, use it; otherwise, use the default
97+ if [ -n "${ADDITIONAL_GO_LDFLAGS}" ]; then
98+ docker run --rm -v .:/harbor -w /harbor/src/${{ matrix.src_name || matrix.container}} golang:1.24.6 /usr/local/go/bin/go build -buildvcs=false -o /harbor/make/photon/${{ matrix.container }}/${{matrix.build_binary}} -ldflags "${ADDITIONAL_GO_LDFLAGS}"
99+ else
100+ docker run --rm -v .:/harbor -w /harbor/src/${{ matrix.src_name || matrix.container}} golang:1.24.6 /usr/local/go/bin/go build -buildvcs=false -o /harbor/make/photon/${{ matrix.container }}/${{matrix.build_binary}}
101+ fi
102+
97103 - name : Run custom build script
98104 if : ${{ matrix.run_build_script }}
99105 run : |
You can’t perform that action at this time.
0 commit comments