#!/usr/bin/env sh

set -ex
export "COMMIT"="e78a3f2554678ced6f22c3c9789d1187e9f2b5f8"
export "REVISION"="2"
export "VERSION"="0.37.0~rc2"

(
set -u

cd buildx
go build -mod=vendor \
  -ldflags "-X github.com/docker/buildx/version.Version=${VERSION}-${REVISION} -X github.com/docker/buildx/version.Revision=${COMMIT} -X github.com/docker/buildx/version.Package=github.com/docker/buildx" \
  -o docker-buildx \
  ./cmd/buildx

)
