Skip to content

ci(0.76): don't use an npmrc #2630

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Aug 11, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 5 additions & 15 deletions .ado/jobs/npm-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,19 +52,6 @@ jobs:

# Disable Nightly publishing on the main branch
- ${{ if endsWith(variables['Build.SourceBranchName'], '-stable') }}:
- script: |
if [ "$(USE_YARN_FOR_PUBLISH)" = "true" ]; then
echo "Configuring yarn for npm publishing"
yarn config set npmPublishRegistry "https://registry.npmjs.org"
yarn config set npmAuthToken $(npmAuthToken)
else
echo "Configuring npm for publishing"
echo "//registry.npmjs.org/:_authToken=$(npmAuthToken)" > ~/.npmrc
fi
node .ado/scripts/prepublish-check.mjs --verbose --tag $(publishTag)
displayName: Set and validate npm auth
condition: and(succeeded(), eq(variables['publish_react_native_macos'], '1'))

- script: |
git switch $(Build.SourceBranchName)
yarn nx release --skip-publish --verbose
Expand All @@ -81,13 +68,16 @@ jobs:
# Let's call publish directly instead on the packages we want to publish.
# yarn nx release publish --tag $(publishTag) --excludeTaskDependencies
if [ "$(USE_YARN_FOR_PUBLISH)" = "true" ]; then
echo "Configuring yarn for npm publishing"
yarn config set npmPublishRegistry "https://registry.npmjs.org"
yarn config set npmAuthToken $(npmAuthToken)
echo "Publishing with yarn npm publish"
yarn ./packages/virtualized-lists npm publish --tag $(publishTag)
yarn ./packages/react-native npm publish --tag $(publishTag)
else
echo "Publishing with npm publish"
(cd ./packages/virtualized-lists && npm publish --tag $(publishTag))
(cd ./packages/react-native && npm publish --tag $(publishTag))
npm publish ./packages/virtualized-lists --tag $(npmDistTag) --registry https://registry.npmjs.org/ --//registry.npmjs.org/:_authToken=$(npmAuthToken)
npm publish ./packages/react-native --tag $(npmDistTag) --registry https://registry.npmjs.org/ --//registry.npmjs.org/:_authToken=$(npmAuthToken)
fi
fi
displayName: Publish packages
Expand Down