From 845c1409e39cbfebff1839c606512733f2343943 Mon Sep 17 00:00:00 2001 From: Alberto Schiabel Date: Mon, 4 Dec 2023 17:22:32 +0100 Subject: [PATCH] fix(ci): wasm integration pipeline for prisma/prisma (#4516) * fix(ci): wasm integration pipeline for prisma/prisma * chore: retrigger CI/CD * Fix the CI check --------- Co-authored-by: Alexey Orlenko --- query-engine/query-engine-wasm/build.sh | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/query-engine/query-engine-wasm/build.sh b/query-engine/query-engine-wasm/build.sh index 12d8328305ff..184e4baf3545 100755 --- a/query-engine/query-engine-wasm/build.sh +++ b/query-engine/query-engine-wasm/build.sh @@ -5,10 +5,25 @@ OUT_VERSION="$1" OUT_FOLDER="pkg" OUT_JSON="${OUT_FOLDER}/package.json" -OUT_TARGET="bundler" # Note(jkomyno): I wasn't able to make it work with `web` target +OUT_TARGET="bundler" OUT_NPM_NAME="@prisma/query-engine-wasm" -wasm-pack build --release --target $OUT_TARGET +# The local ./Cargo.toml file uses "name = "query_engine_wasm" as library name +# to avoid conflicts with libquery's `name = "query_engine"` library name declaration. +# This little `sed -i` trick below is a hack to publish "@prisma/query-engine-wasm" +# with the same binding filenames currently expected by the Prisma Client. +sed -i '' 's/name = "query_engine_wasm"/name = "query_engine"/g' Cargo.toml + +# use `wasm-pack build --release` on CI only +if [[ -z "$BUILDKITE" ]] && [[ -z "$GITHUB_ACTIONS" ]]; then + BUILD_PROFILE="--dev" +else + BUILD_PROFILE="--release" +fi + +wasm-pack build $BUILD_PROFILE --target $OUT_TARGET + +sed -i '' 's/name = "query_engine"/name = "query_engine_wasm"/g' Cargo.toml sleep 1