mirror of
https://github.com/penpot/penpot.git
synced 2026-08-08 05:48:50 +00:00
44 lines
1001 B
Bash
Executable File
44 lines
1001 B
Bash
Executable File
#!/usr/bin/env bash
|
|
|
|
set -ex
|
|
|
|
export CURRENT_VERSION=$1;
|
|
export NODE_ENV=production;
|
|
|
|
corepack enable;
|
|
corepack install || exit 1;
|
|
pnpm install || exit 1;
|
|
rm -rf target
|
|
|
|
# Build the application
|
|
pnpm run build;
|
|
|
|
cp pnpm-lock.yaml target/;
|
|
cp pnpm-workspace.yaml target/;
|
|
cp package.json target/;
|
|
touch target/pnpm-workspace.yaml;
|
|
|
|
# The headless renderer (PENPOT_WASM_HEADLESS) needs the render-wasm artifact.
|
|
WASM_SRC="../frontend/resources/public/js";
|
|
if [ ! -f "$WASM_SRC/render-wasm.wasm" ]; then
|
|
echo "ERROR: $WASM_SRC/render-wasm.wasm is missing." >&2;
|
|
echo "Build it first with: (cd render-wasm && ./build)" >&2;
|
|
exit 1;
|
|
fi
|
|
|
|
mkdir -p target/js;
|
|
cp "$WASM_SRC/render-wasm.js" "$WASM_SRC/render-wasm.wasm" target/js/;
|
|
|
|
cat <<EOF | tee target/setup
|
|
#/usr/bin/env bash
|
|
set -e;
|
|
corepack enable;
|
|
corepack install;
|
|
pnpm install
|
|
pnpm exec playwright install chromium;
|
|
EOF
|
|
|
|
chmod +x target/setup;
|
|
|
|
sed -i -re "s/\%version\%/$CURRENT_VERSION/g" ./target/app.js ./target/worker/wasm-worker.js;
|