mirror of
https://github.com/aljazceru/ark.git
synced 2025-12-18 04:34:19 +01:00
pkg/client-sdk/wasm: build wasm (#238)
Signed-off-by: tiero <3596602+tiero@users.noreply.github.com>
This commit is contained in:
@@ -1,21 +1,41 @@
|
||||
#!/bin/bash
|
||||
|
||||
set -e
|
||||
|
||||
# Get the parent directory path
|
||||
PARENT_PATH=$(dirname $(
|
||||
cd $(dirname $0)
|
||||
pwd -P
|
||||
cd $(dirname $0)
|
||||
pwd -P
|
||||
))
|
||||
|
||||
# Define OS and ARCH arrays
|
||||
declare -a OS=("darwin" "linux")
|
||||
declare -a ARCH=("amd64" "arm64")
|
||||
|
||||
# Change to the parent directory
|
||||
pushd $PARENT_PATH
|
||||
|
||||
# Function to handle errors
|
||||
handle_error() {
|
||||
echo "Error occurred in build for $1 $2"
|
||||
echo "Build command: GOOS=$1 GOARCH=$2 ./scripts/build"
|
||||
echo "Exit code: $3"
|
||||
echo "You may want to run this build manually to see more detailed error messages."
|
||||
}
|
||||
|
||||
# Loop through OS and ARCH combinations
|
||||
for os in "${OS[@]}"; do
|
||||
for arch in "${ARCH[@]}"; do
|
||||
GOOS=$os GOARCH=$arch ./scripts/build
|
||||
done
|
||||
for arch in "${ARCH[@]}"; do
|
||||
echo "Building for $os $arch"
|
||||
if GOOS=$os GOARCH=$arch ./scripts/build; then
|
||||
echo "Build successful for $os $arch"
|
||||
else
|
||||
handle_error $os $arch $?
|
||||
fi
|
||||
echo "------------------------"
|
||||
done
|
||||
done
|
||||
|
||||
popd
|
||||
# Return to the original directory
|
||||
popd
|
||||
|
||||
echo "All builds completed."
|
||||
Reference in New Issue
Block a user