storj/scripts/build-wasm.sh
Egon Elbre 4a6c2e2a9c satellite/admin/ui: avoid needing an additional copy
This also fixes the build order. Unfortunately we need
to ensure that the web frontends are built before installing
Go binaries.

Fixes https://github.com/storj/storj/issues/4654

Change-Id: I5d1c83125fd3d1a454d3400b2cbdd44bd3f2250c
2022-03-25 11:42:22 +02:00

20 lines
492 B
Bash
Executable File

#!/usr/bin/env bash
set -eu
set -o pipefail
# Ensure the directory exists
mkdir -p release/$TAG/wasm/
# Copy wasm javascript to match the go version
cp "$(go env GOROOT)/misc/wasm/wasm_exec.js" release/$TAG/wasm/
# Compress wasm javascript using brotli
brotli -k release/$TAG/wasm/wasm_exec.js
# Build wasm code
GOOS=js GOARCH=wasm go build -o release/$TAG/wasm/access.wasm storj.io/storj/satellite/console/wasm
# Compress wasm code using brotli
brotli -k release/$TAG/wasm/access.wasm