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,18 +1,32 @@
|
||||
|
||||
#!/bin/bash
|
||||
|
||||
set -e
|
||||
|
||||
# Get the parent directory path
|
||||
PARENT_PATH=$(dirname $(
|
||||
cd $(dirname $0)
|
||||
pwd -P
|
||||
cd $(dirname $0)
|
||||
pwd -P
|
||||
))
|
||||
|
||||
OS=$(eval "go env GOOS")
|
||||
ARCH=$(eval "go env GOARCH")
|
||||
# Set VERSION (you can modify this to get the version from a file or environment variable)
|
||||
VERSION=$(git describe --tags --always --dirty 2>/dev/null || echo "unknown")
|
||||
|
||||
# Get OS and ARCH
|
||||
OS=$(go env GOOS)
|
||||
ARCH=$(go env GOARCH)
|
||||
|
||||
echo "Building arkd for $OS $ARCH"
|
||||
echo "Version: $VERSION"
|
||||
|
||||
# Change to the parent directory
|
||||
pushd $PARENT_PATH
|
||||
|
||||
# Create build directory if it doesn't exist
|
||||
mkdir -p build
|
||||
GO111MODULE=on go build -o build/arkd-$OS-$ARCH ./cmd/arkd
|
||||
popd
|
||||
|
||||
|
||||
# Build the binary with version information
|
||||
go build -ldflags="-s -w -X 'main.Version=$VERSION'" -o build/arkd-$OS-$ARCH ./cmd/arkd
|
||||
|
||||
echo "Build complete: build/arkd-$OS-$ARCH"
|
||||
|
||||
# Return to the original directory
|
||||
popd
|
||||
|
||||
Reference in New Issue
Block a user