mirror of
https://gitea.com/Lydanne/buildx.git
synced 2025-07-09 21:17:09 +08:00
GitHub Actions release
Signed-off-by: CrazyMax <crazy-max@users.noreply.github.com>
This commit is contained in:
27
hack/release
27
hack/release
@ -3,30 +3,29 @@
|
||||
TAG=$1
|
||||
OUT=$2
|
||||
|
||||
. $(dirname $0)/util
|
||||
set -eu -o pipefail
|
||||
|
||||
: ${PLATFORMS=linux/amd64}
|
||||
: ${CONTINUOUS_INTEGRATION=}
|
||||
|
||||
progressFlag=""
|
||||
if [ "$CONTINUOUS_INTEGRATION" == "true" ]; then progressFlag="--progress=plain"; fi
|
||||
|
||||
|
||||
usage() {
|
||||
echo "usage: ./hack/release <tag> <out>"
|
||||
exit 1
|
||||
}
|
||||
|
||||
if [ -z "$TAG" ] || [ -z "$OUT" ]; then
|
||||
if [ -z "$TAG" ] || [ -z "$OUT" ]; then
|
||||
usage
|
||||
fi
|
||||
|
||||
importCacheFlags=""
|
||||
if [[ -n "$cacheRefFrom" ]] && [[ "$cacheType" = "local" ]]; then
|
||||
for ref in $cacheRefFrom; do
|
||||
importCacheFlags="$importCacheFlags--cache-from=type=local,src=$ref "
|
||||
done
|
||||
fi
|
||||
|
||||
set -x
|
||||
|
||||
buildctl build $progressFlag --frontend=dockerfile.v0 \
|
||||
--local context=. --local dockerfile=. \
|
||||
--opt target=release \
|
||||
--opt platform=$PLATFORMS \
|
||||
--exporter local \
|
||||
--exporter-opt output=$OUT
|
||||
buildxCmd build $importCacheFlags \
|
||||
--target "release" \
|
||||
--platform "$PLATFORMS" \
|
||||
--output "type=local,dest=$OUT" \
|
||||
$currentcontext
|
||||
|
Reference in New Issue
Block a user