Skip to content

Commit 382cc4c

Browse files
committed
Revert "ci(0.78): don't use an npmrc (#2627)"
This reverts commit 88c430a.
1 parent 214a401 commit 382cc4c

File tree

1 file changed

+15
-5
lines changed

1 file changed

+15
-5
lines changed

.ado/jobs/npm-publish.yml

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,19 @@ jobs:
5252
5353
# Disable Nightly publishing on the main branch
5454
- ${{ if endsWith(variables['Build.SourceBranchName'], '-stable') }}:
55+
- script: |
56+
if [ "$(USE_YARN_FOR_PUBLISH)" = "true" ]; then
57+
echo "Configuring yarn for npm publishing"
58+
yarn config set npmPublishRegistry "https://registry.npmjs.org"
59+
yarn config set npmAuthToken $(npmAuthToken)
60+
else
61+
echo "Configuring npm for publishing"
62+
echo "//registry.npmjs.org/:_authToken=$(npmAuthToken)" > ~/.npmrc
63+
fi
64+
node .ado/scripts/prepublish-check.mjs --verbose --tag $(publishTag)
65+
displayName: Set and validate npm auth
66+
condition: and(succeeded(), eq(variables['publish_react_native_macos'], '1'))
67+
5568
- script: |
5669
git switch $(Build.SourceBranchName)
5770
yarn nx release --skip-publish --verbose
@@ -68,16 +81,13 @@ jobs:
6881
# Let's call publish directly instead on the packages we want to publish.
6982
# yarn nx release publish --tag $(publishTag) --excludeTaskDependencies
7083
if [ "$(USE_YARN_FOR_PUBLISH)" = "true" ]; then
71-
echo "Configuring yarn for npm publishing"
72-
yarn config set npmPublishRegistry "https://registry.npmjs.org"
73-
yarn config set npmAuthToken $(npmAuthToken)
7484
echo "Publishing with yarn npm publish"
7585
yarn ./packages/virtualized-lists npm publish --tag $(publishTag)
7686
yarn ./packages/react-native npm publish --tag $(publishTag)
7787
else
7888
echo "Publishing with npm publish"
79-
npm publish ./packages/virtualized-lists --tag $(npmDistTag) --registry https://registry.npmjs.org/ --//registry.npmjs.org/:_authToken=$(npmAuthToken)
80-
npm publish ./packages/react-native --tag $(npmDistTag) --registry https://registry.npmjs.org/ --//registry.npmjs.org/:_authToken=$(npmAuthToken)
89+
(cd ./packages/virtualized-lists && npm publish --tag $(publishTag))
90+
(cd ./packages/react-native && npm publish --tag $(publishTag))
8191
fi
8292
fi
8393
displayName: Publish packages

0 commit comments

Comments
 (0)