From fb70c9e07a61ef954f28dc537609a9ec6fa4e508 Mon Sep 17 00:00:00 2001 From: Kevin Chen Date: Wed, 9 Aug 2023 18:41:31 -0400 Subject: [PATCH] wip --- projects/buf.build/package.yml | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/projects/buf.build/package.yml b/projects/buf.build/package.yml index 93747da669..5bd1df55bd 100644 --- a/projects/buf.build/package.yml +++ b/projects/buf.build/package.yml @@ -9,25 +9,26 @@ provides: - bin/buf build: - script: - - make build install - - mkdir -p "{{ prefix }}"/bin - - mv ~/.cache/buf/$PLATFORM/gobin/buf "{{ prefix }}"/bin + script: | + go mod download + mkdir -p "{{ prefix }}"/bin + go build -v -trimpath -ldflags="$LDFLAGS" -o $BUILDLOC ./cmd/buf dependencies: go.dev: ^1.20 - gnu.org/make: '*' env: - darwin/aarch64: {PLATFORM: Darwin/arm64} - darwin/x86-64: {PLATFORM: Darwin/x64} - linux/aarch64: {PLATFORM: Linux/arm64} - linux/x86-64: {PLATFORM: Linux/x64} GO111MODULE: on CGO_ENABLED: 0 + BUILDLOC: '{{prefix}}/bin/buf' + LDFLAGS: + - -s + - -w + - -X main.version={{version}} + - -X main.debugMode=false linux: # or segmentation fault # fix found here https://github.com/docker-library/golang/issues/402#issuecomment-982204575 LDFLAGS: - -buildmode=pie -test: +test: | buf --version | grep {{version}}