Skip to content

Commit

Permalink
Merge pull request #2843 from go-swagger/fix-spec-gen-binaries
Browse files Browse the repository at this point in the history
build without -trimpath because it causes issues when generating a spec
  • Loading branch information
casualjim committed Sep 25, 2022
2 parents 91b12fd + cad59e4 commit 7684453
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 13 deletions.
21 changes: 9 additions & 12 deletions .github/workflows/test.yaml
Expand Up @@ -244,22 +244,19 @@ jobs:
if [[ $1 == "windows" ]]; then
out="${out}.exe"
fi
GOOS=$1 GOARCH=$2 CGO_ENABLED=0 go build -trimpath -ldflags "$LDFLAGS" -tags osusergo,netgo -o "./dist/bin/$out" ./cmd/swagger
GOOS=$1 GOARCH=$2 CGO_ENABLED=0 go build -ldflags "$LDFLAGS" -tags osusergo,netgo -o "./dist/bin/$out" ./cmd/swagger
}
go mod download
build_binary linux amd64 &
build_binary linux arm64 &
build_binary linux arm &
build_binary linux ppc64le &
wait
build_binary darwin amd64 &
build_binary darwin arm64 &
wait
build_binary windows amd64 &
build_binary windows arm64 &
wait
build_binary linux amd64
build_binary linux arm64
build_binary linux arm
build_binary linux ppc64le
build_binary darwin amd64
build_binary darwin arm64
build_binary windows amd64
build_binary windows arm64
nfpm p -p deb -t dist/build
nfpm p -p rpm -t dist/build
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
Expand Up @@ -13,7 +13,7 @@ RUN apk --no-cache add ca-certificates shared-mime-info mailcap git build-base b
RUN mkdir -p bin &&\
LDFLAGS="$LDFLAGS -X github.com/go-swagger/go-swagger/cmd/swagger/commands.Commit=${commit_hash}" &&\
LDFLAGS="$LDFLAGS -X github.com/go-swagger/go-swagger/cmd/swagger/commands.Version=${tag_name}" &&\
CGO_ENABLED=0 GOOS=$TARGETOS GOARCH=$TARGETARCH go build -trimpath -tags osusergo,netgo -o bin/swagger -ldflags "$LDFLAGS" -a ./cmd/swagger
CGO_ENABLED=0 GOOS=$TARGETOS GOARCH=$TARGETARCH go build -tags osusergo,netgo -o bin/swagger -ldflags "$LDFLAGS" -a ./cmd/swagger

FROM --platform=$TARGETPLATFORM golang:alpine

Expand Down

0 comments on commit 7684453

Please sign in to comment.