Correctly specify files to be packed in a npm package (#3168)

This commit is contained in:
Gyeongjae Choi 2022-10-12 13:54:12 +09:00 committed by GitHub
parent 693570755c
commit 7d3e19b0f6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 21 additions and 2 deletions

View File

@ -383,6 +383,11 @@ jobs:
git checkout 164054a9c6fbd2176f386b6552ed8d079c6bcc04
./build.sh
- run:
name: test npm deploy (dry run)
command: |
DRY_RUN=1 ./tools/deploy_to_npm.sh
test-cmdline-runner:
<<: *defaults
steps:

View File

@ -61,7 +61,14 @@
"./repodata.json": "./repodata.json"
},
"files": [
"pyodide*",
"pyodide.asm.js",
"pyodide.asm.wasm",
"pyodide.asm.data",
"pyodide_py.tar",
"pyodide.mjs",
"pyodide.js.map",
"pyodide.mjs.map",
"pyodide.d.ts",
"repodata.json",
"console.html"
],

View File

@ -4,14 +4,21 @@ set -e
echo "//registry.npmjs.org/:_authToken=${NPM_TOKEN}" > ~/.npmrc
SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )
cd "$SCRIPT_DIR"/..
# FIXME: since we release from dist directory, README file needs to be copied before release
cp src/js/README.md dist/
cp src/js/package.json dist/
cd dist/
PACKAGE_NAME=$(node -p "require('./package.json').name")
JS_VERSION=$(node -p "require('./package.json').version")
if [[ ${JS_VERSION} =~ [alpha|beta|rc|dev] ]]; then
if [[ -n "${DRY_RUN}" ]]; then
echo "Dry run: npm publish --tag ${JS_VERSION}"
npm publish --dry-run
elif [[ ${JS_VERSION} =~ [alpha|beta|rc|dev] ]]; then
echo "Publishing an unstable release"
npm publish --tag next
else