egui-circles/wasm32/build.sh
2024-08-30 22:06:23 +02:00

61 lines
1.2 KiB
Bash
Executable File

#!/usr/bin/env bash
set -euo pipefail
NAME=egui-circles
BUILDER=djmil/$NAME-builder:0.0.1
TRAGET=$NAME-wasm32
has_docker_image() {
docker manifest inspect $1
} &> /dev/null
has_docker_container() {
docker container inspect $1
} &> /dev/null
if ! has_docker_image $BUILDER; then
echo "Docker $BUILDER was not found"
read -p "Would you like to create builder image (y/n)? "
case "$REPLY" in
y|Y )
docker build --tag $BUILDER . ;;
* )
exit 1 ;;
esac
fi
echo "--> Initiate WASM32 target build.."
docker run \
--rm \
--volume $(pwd):/$NAME \
--name $TRAGET \
$BUILDER \
build --release --public-url /$NAME --verbose
echo "--> wasm32 target can be found in dist/ folder"
read -p "Would you like to publish (y/n)? "
case "$REPLY" in
y|Y )
cd dist/
git init
git checkout -b main
git add .
git commit --message «v0.2.1»
# solution for "send-pack: unexpected disconnect while reading sideband packet"
git config http.postBuffer 157286400
git remote add origin https://gitea.djmil.dev/demo/egui-circles.git
git push --set-upstream origin main --force
echo "--> Published at https://demo.pages.djmil.dev/egui-circles"
;;
* )
exit 0
;;
esac