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

@@ -5,10 +5,9 @@
"command": { "command": {
"publish": { "publish": {
"npmClient": "npm", "npmClient": "npm",
"allowBranch": ["master", "canary"], "allowBranch": ["master"],
"registry": "https://registry.npmjs.org/" "registry": "https://registry.npmjs.org/"
} }
}, },
"version": "independent" "version": "independent"
} }

View File

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

4
utils/publish.sh vendored
View File

@@ -1,6 +1,10 @@
#!/bin/bash #!/bin/bash
set -euo pipefail 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 )" __dirname="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
echo "__dirname: ${__dirname}" echo "__dirname: ${__dirname}"