2024-08-31 12:23:28 +02:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
set -euo pipefail
|
|
|
|
|
|
|
|
NAME=egui-circles
|
|
|
|
BUILDER=$NAME-builder: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"
|
|
|
|
|
2024-08-31 19:55:05 +02:00
|
|
|
read -p "Would you like to create builder image (Yes/No/Cancel)? "
|
2024-08-31 12:23:28 +02:00
|
|
|
case "$REPLY" in
|
2024-08-31 19:55:05 +02:00
|
|
|
y|Y|yes|Yes|YES )
|
2024-08-31 12:23:28 +02:00
|
|
|
docker build \
|
|
|
|
--file wasm32/Dockerfile \
|
|
|
|
--tag $BUILDER \
|
|
|
|
.
|
|
|
|
;;
|
2024-08-31 19:55:05 +02:00
|
|
|
n|N|no|No|NO ) ;;
|
|
|
|
* ) exit 0 ;;
|
2024-08-31 12:23:28 +02:00
|
|
|
esac
|
|
|
|
fi
|
|
|
|
|
|
|
|
echo "--> Initiate WASM32 target build.."
|
|
|
|
|
|
|
|
docker run \
|
|
|
|
--rm \
|
|
|
|
--volume $(pwd):/$NAME \
|
|
|
|
$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 .
|
2024-08-31 19:55:05 +02:00
|
|
|
git commit --message «v0.2.2»
|
2024-08-31 12:23:28 +02:00
|
|
|
|
|
|
|
# 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
|