cross platform build

This commit is contained in:
djmil 2024-08-31 12:02:43 +02:00
parent e15996f5aa
commit 20563f970f

View File

@ -2,8 +2,7 @@
set -euo pipefail set -euo pipefail
NAME=egui-circles NAME=egui-circles
BUILDER=djmil/$NAME-builder:0.0.1 BUILDER=$NAME-builder:wasm32
TRAGET=$NAME-wasm32
has_docker_image() { has_docker_image() {
docker manifest inspect $1 docker manifest inspect $1
@ -16,10 +15,14 @@ has_docker_container() {
if ! has_docker_image $BUILDER; then if ! has_docker_image $BUILDER; then
echo "Docker $BUILDER was not found" echo "Docker $BUILDER was not found"
read -p "Would you like to create builder image (y/n)? " read -p "Would you like to create builder image (y/N)? "
case "$REPLY" in case "$REPLY" in
y|Y ) y|Y )
docker build --tag $BUILDER . ;; docker build \
--file wasm32/Dockerfile \
--tag $BUILDER \
.
;;
* ) * )
exit 1 ;; exit 1 ;;
esac esac
@ -30,13 +33,12 @@ echo "--> Initiate WASM32 target build.."
docker run \ docker run \
--rm \ --rm \
--volume $(pwd):/$NAME \ --volume $(pwd):/$NAME \
--name $TRAGET \
$BUILDER \ $BUILDER \
build --release --public-url /$NAME --verbose build --release --public-url /$NAME --verbose
echo "--> wasm32 target can be found in dist/ folder" echo "--> wasm32 target can be found in dist/ folder"
read -p "Would you like to publish (y/n)? " read -p "Would you like to publish (y/N)? "
case "$REPLY" in case "$REPLY" in
y|Y ) y|Y )
cd dist/ cd dist/