Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(ci): wasm integration pipeline for prisma/prisma #4516

Merged
merged 3 commits into from
Dec 4, 2023
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 17 additions & 2 deletions query-engine/query-engine-wasm/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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="--release"
else
BUILD_PROFILE="--dev"
aqrln marked this conversation as resolved.
Show resolved Hide resolved
fi

wasm-pack build $BUILD_PROFILE --target $OUT_TARGET

sed -i '' 's/name = "query_engine"/name = "query_engine_wasm"/g' Cargo.toml

sleep 1

Expand Down
Loading