From ff36dc3f0b0ff12209f1883436610e0e39d2a7ff Mon Sep 17 00:00:00 2001 From: LastLeaf Date: Thu, 26 Dec 2024 17:15:49 +0800 Subject: [PATCH] build: update publish script --- deprecate.sh | 3 +++ publish.sh | 14 ++++++++++++++ 2 files changed, 17 insertions(+) diff --git a/deprecate.sh b/deprecate.sh index a23ca9f..07c8251 100755 --- a/deprecate.sh +++ b/deprecate.sh @@ -15,3 +15,6 @@ for PROJECT in $PROJECTS; do echo "Deprecating ${PROJECT}..." cargo yank --version "${VERSION}" "${PROJECT}" done + +# npm deprecate +npm deprecate "float-pigment-css@${VERSION}" --registry https://registry.npmjs.org -m "sync with cargo yank" diff --git a/publish.sh b/publish.sh index ba19d4f..a534ad4 100755 --- a/publish.sh +++ b/publish.sh @@ -52,6 +52,14 @@ else exit -1 fi +# run wasm-pack +if wasm-pack build float-pigment-css --target nodejs --features nodejs-package; then + echo 'WebAssembly built for float-pigment-css.' +else + echo 'Failed to build WebAssembly package for float-pigment-css! Abort.' + exit -1 +fi + # git operations if [ -z "$(git status --porcelain)" ]; then echo 'Git status OK.' @@ -113,3 +121,9 @@ for PROJECT in $PROJECTS; do echo "Publishing ${PROJECT}..." cargo publish -p "${PROJECT}" done + +# npm publish +cd float-pigment-css/pkg +echo "Publishing NPM package for float-pigment-css..." +npm publish --registry https://registry.npmjs.org +cd ../..