Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
kevinmichaelchen committed Aug 9, 2023
1 parent 8e089e1 commit fb70c9e
Showing 1 changed file with 11 additions and 10 deletions.
21 changes: 11 additions & 10 deletions projects/buf.build/package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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}}

0 comments on commit fb70c9e

Please sign in to comment.