mirror of
https://github.com/LukeHagar/vercel.git
synced 2025-12-06 04:22:01 +00:00
<picture data-single-emoji=":pnpm:" title=":pnpm:"><img class="emoji" src="https://single-emoji.vercel.app/api/emoji/eyJhbGciOiJkaXIiLCJlbmMiOiJBMjU2R0NNIn0..4mJzrO94AnSn0Pue.4apgaKtTUdQ-wxNyahjdJj28u8bbXreLoTA8AGqYjLta3MrsFvbo9DsQFth4CoIkBgXFhQ5_BVcKNfYbwLg4bKzyIvItKe4OFS8AzG7Kkicz2kUUZk0.nXyK_PvHzZFGA-MQB6XHfA" alt=":pnpm:" width="20" height="auto" align="absmiddle"></picture> yarn has become increasingly more difficult to use as the v1 we rely on no longer receives updates. pnpm is faster and is actively maintained. This PR migrates us to pnpm.
39 lines
987 B
Bash
Executable File
Vendored
39 lines
987 B
Bash
Executable File
Vendored
#!/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
|
|
|
|
if [ -z "$NPM_TOKEN" ]; then
|
|
echo "NPM_TOKEN not found. Did you forget to assign the GitHub Action secret?"
|
|
exit 1
|
|
fi
|
|
|
|
echo "//registry.npmjs.org/:_authToken=$NPM_TOKEN" >> ~/.npmrc
|
|
|
|
echo "Logged in to npm as: $(npm whoami)"
|
|
|
|
dist_tag=""
|
|
tag="$(git describe --tags --exact-match 2> /dev/null || :)"
|
|
|
|
if [ -z "$tag" ]; then
|
|
echo "Not a tagged commit, skipping publish"
|
|
exit 0
|
|
fi
|
|
|
|
if [[ "$tag" =~ -canary ]]; then
|
|
echo "Publishing canary release"
|
|
dist_tag="--dist-tag canary"
|
|
else
|
|
echo "Publishing stable release"
|
|
fi
|
|
|
|
# Sometimes this is a false alarm and blocks publish
|
|
git checkout pnpm-lock.yaml
|
|
|
|
pnpm run lerna publish from-git $dist_tag --no-verify-access --yes
|
|
|
|
# always update canary dist-tag as we no longer publish canary versions separate
|
|
node ./utils/update-canary-tag.js
|