Skip to content

Commit cad59e4

Browse files
committed
build without -trimpath because it causes issues when generating a spec
1 parent 91b12fd commit cad59e4

File tree

2 files changed

+10
-13
lines changed

2 files changed

+10
-13
lines changed

.github/workflows/test.yaml

+9-12
Original file line numberDiff line numberDiff line change
@@ -244,22 +244,19 @@ jobs:
244244
if [[ $1 == "windows" ]]; then
245245
out="${out}.exe"
246246
fi
247-
GOOS=$1 GOARCH=$2 CGO_ENABLED=0 go build -trimpath -ldflags "$LDFLAGS" -tags osusergo,netgo -o "./dist/bin/$out" ./cmd/swagger
247+
GOOS=$1 GOARCH=$2 CGO_ENABLED=0 go build -ldflags "$LDFLAGS" -tags osusergo,netgo -o "./dist/bin/$out" ./cmd/swagger
248248
}
249249
250250
go mod download
251251
252-
build_binary linux amd64 &
253-
build_binary linux arm64 &
254-
build_binary linux arm &
255-
build_binary linux ppc64le &
256-
wait
257-
build_binary darwin amd64 &
258-
build_binary darwin arm64 &
259-
wait
260-
build_binary windows amd64 &
261-
build_binary windows arm64 &
262-
wait
252+
build_binary linux amd64
253+
build_binary linux arm64
254+
build_binary linux arm
255+
build_binary linux ppc64le
256+
build_binary darwin amd64
257+
build_binary darwin arm64
258+
build_binary windows amd64
259+
build_binary windows arm64
263260
264261
nfpm p -p deb -t dist/build
265262
nfpm p -p rpm -t dist/build

Dockerfile

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ RUN apk --no-cache add ca-certificates shared-mime-info mailcap git build-base b
1313
RUN mkdir -p bin &&\
1414
LDFLAGS="$LDFLAGS -X github.com/go-swagger/go-swagger/cmd/swagger/commands.Commit=${commit_hash}" &&\
1515
LDFLAGS="$LDFLAGS -X github.com/go-swagger/go-swagger/cmd/swagger/commands.Version=${tag_name}" &&\
16-
CGO_ENABLED=0 GOOS=$TARGETOS GOARCH=$TARGETARCH go build -trimpath -tags osusergo,netgo -o bin/swagger -ldflags "$LDFLAGS" -a ./cmd/swagger
16+
CGO_ENABLED=0 GOOS=$TARGETOS GOARCH=$TARGETARCH go build -tags osusergo,netgo -o bin/swagger -ldflags "$LDFLAGS" -a ./cmd/swagger
1717

1818
FROM --platform=$TARGETPLATFORM golang:alpine
1919

0 commit comments

Comments
 (0)