#!/bin/bash


dsc=$(git describe HEAD --tags) || return 1
DOCKER_BUILDKIT=1 docker build --output type=local,dest=./dist . || return 1
if [ ! -f ./dist/opensem-prod.tar.xz ]; then
    echo "Build failed: dist/opensem-prod.tar.xz not found"
    exit 1
fi
mv dist/opensem-prod.tar.xz ./opensem-$dsc.tar.xz &&
rmdir ./dist
echo "Build successful: opensem-$dsc.tar.xz"
