2018-10-11 06:46:34 +00:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
|
|
|
|
TAG=$1
|
|
|
|
OUT=$2
|
|
|
|
|
2020-11-24 21:51:52 +00:00
|
|
|
. $(dirname $0)/util
|
2018-10-11 06:46:34 +00:00
|
|
|
set -eu -o pipefail
|
|
|
|
|
2021-12-20 21:39:21 +00:00
|
|
|
: ${PLATFORMS=}
|
2018-10-11 06:46:34 +00:00
|
|
|
|
|
|
|
usage() {
|
|
|
|
echo "usage: ./hack/release-tar <tag> <out>"
|
|
|
|
exit 1
|
|
|
|
}
|
|
|
|
|
2020-07-25 03:36:55 +00:00
|
|
|
if [ -z "$TAG" ] || [ -z "$OUT" ]; then
|
2018-10-11 06:46:34 +00:00
|
|
|
usage
|
|
|
|
fi
|
|
|
|
|
2021-12-20 21:39:21 +00:00
|
|
|
platformFlag=""
|
|
|
|
if [ -n "$PLATFORMS" ]; then
|
|
|
|
platformFlag="--platform=$PLATFORMS"
|
|
|
|
fi
|
|
|
|
|
|
|
|
buildxCmd build $platformFlag $cacheFromFlags \
|
2020-11-24 21:51:52 +00:00
|
|
|
--target release \
|
|
|
|
--output "type=local,dest=$OUT" \
|
|
|
|
$currentcontext
|