From 5a20ada1bf4f2740a95e4cbca64d97371ee7bba0 Mon Sep 17 00:00:00 2001 From: Kevin Chen Date: Thu, 10 Aug 2023 13:38:44 -0400 Subject: [PATCH] +buf.build (#2778) * +buf * fix * wip --- projects/buf.build/package.yml | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 projects/buf.build/package.yml diff --git a/projects/buf.build/package.yml b/projects/buf.build/package.yml new file mode 100644 index 0000000000..5bd1df55bd --- /dev/null +++ b/projects/buf.build/package.yml @@ -0,0 +1,34 @@ +distributable: + url: https://github.com/bufbuild/buf/archive/refs/tags/v{{version}}.tar.gz + strip-components: 1 + +versions: + github: bufbuild/buf + +provides: + - bin/buf + +build: + script: | + go mod download + mkdir -p "{{ prefix }}"/bin + go build -v -trimpath -ldflags="$LDFLAGS" -o $BUILDLOC ./cmd/buf + dependencies: + go.dev: ^1.20 + env: + 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: | + buf --version | grep {{version}}