File tree Expand file tree Collapse file tree 2 files changed +11
-13
lines changed Expand file tree Collapse file tree 2 files changed +11
-13
lines changed Original file line number Diff line number Diff line change @@ -62,26 +62,19 @@ jobs:
6262 go-version-file : " go.mod"
6363
6464 - name : Build binary for linux/amd64
65- run : |
66- TAG=$(git describe --always)
67- mkdir -p bin
68- CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build \
69- -ldflags "-X github.com/coder/code-marketplace/buildinfo.tag=${TAG}" \
70- -o bin/code-marketplace-linux-amd64 \
71- ./cmd/marketplace/main.go
65+ run : make build/linux/amd64
7266
7367 - name : Set up Docker Buildx
7468 uses : docker/setup-buildx-action@v3
7569
7670 - name : Build Docker image
7771 id : build
7872 run : |
79- docker buildx build \
80- --platform linux/amd64 \
81- --tag code-marketplace:scan \
82- --load \
83- --build-arg TARGETARCH=amd64 \
84- .
73+ docker buildx bake \
74+ -f ./docker-bake.hcl \
75+ --set "*.platform=linux/amd64" \
76+ --set "*.tags=code-marketplace:scan" \
77+ --load
8578 echo "image=code-marketplace:scan" >> "$GITHUB_OUTPUT"
8679
8780 - name : Run Trivy vulnerability scanner (table output for logs)
Original file line number Diff line number Diff line change @@ -27,6 +27,11 @@ upload:
2727
2828TAG =$(shell git describe --always)
2929
30+ build/linux/amd64 :
31+ mkdir -p bin
32+ CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -ldflags " -X github.com/coder/code-marketplace/buildinfo.tag=$( TAG) " -o bin/code-marketplace-linux-amd64 ./cmd/marketplace/main.go
33+ .PHONY : build/linux/amd64
34+
3035build :
3136 CGO_ENABLED=0 GOOS=darwin GOARCH=amd64 go build -ldflags " -X github.com/coder/code-marketplace/buildinfo.tag=$( TAG) " -o bin/code-marketplace-mac-amd64 ./cmd/marketplace/main.go
3237 CGO_ENABLED=0 GOOS=darwin GOARCH=arm64 go build -ldflags " -X github.com/coder/code-marketplace/buildinfo.tag=$( TAG) " -o bin/code-marketplace-mac-arm64 ./cmd/marketplace/main.go
You can’t perform that action at this time.
0 commit comments