Ensure the npm registry is used during "Publish" workflow (#4286)

Unset the `npm_config_registry` env var which yarn overwrites to the
yarn registry, which we don't want since the `.npmrc` file that gets
created is configured to the npm registry.
This commit is contained in:
Nathan Rajlich
2020-05-07 12:00:16 -07:00
committed by GitHub
parent f459db9f83
commit 4b39e96c28
3 changed files with 18 additions and 15 deletions

View File

@@ -1,14 +1,13 @@
{
"npmClient": "yarn",
"useWorkspaces": true,
"packages": ["packages/*"],
"command": {
"publish": {
"npmClient": "npm",
"allowBranch": ["master", "canary"],
"registry": "https://registry.npmjs.org/"
}
},
"version": "independent"
}
"npmClient": "yarn",
"useWorkspaces": true,
"packages": ["packages/*"],
"command": {
"publish": {
"npmClient": "npm",
"allowBranch": ["master"],
"registry": "https://registry.npmjs.org/"
}
},
"version": "independent"
}

View File

@@ -23,6 +23,6 @@ for tag in $tags; do
npm_tag="--tag canary"
fi
echo "Running \`npm publish --registry=https://registry.npmjs.com $npm_tag\` in \"$(pwd)\""
echo "DRY: npm publish --registry=https://registry.npmjs.com $npm_tag"
echo "Running \`npm publish $npm_tag\` in \"$(pwd)\""
npm publish $npm_tag
done

4
utils/publish.sh vendored
View File

@@ -1,6 +1,10 @@
#!/bin/bash
set -euo pipefail
# `yarn` overwrites this value to use the yarn registry, which we
# can't publish to. Unset so that the default npm registry is used.
unset npm_config_registry
__dirname="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
echo "__dirname: ${__dirname}"