Skip to content

Commit

Permalink
fix(ci): wasm integration pipeline for prisma/prisma (#4516)
Browse files Browse the repository at this point in the history
* fix(ci): wasm integration pipeline for prisma/prisma

* chore: retrigger CI/CD

* Fix the CI check

---------

Co-authored-by: Alexey Orlenko <alex@aqrln.net>
  • Loading branch information
jkomyno and aqrln committed Dec 4, 2023
1 parent a0c366a commit 845c140
Showing 1 changed file with 17 additions and 2 deletions.
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="--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

Expand Down

0 comments on commit 845c140

Please sign in to comment.