52
52
53
53
# Disable Nightly publishing on the main branch
54
54
- ${{ 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
+
55
68
- script : |
56
69
git switch $(Build.SourceBranchName)
57
70
yarn nx release --skip-publish --verbose
@@ -68,16 +81,13 @@ jobs:
68
81
# Let's call publish directly instead on the packages we want to publish.
69
82
# yarn nx release publish --tag $(publishTag) --excludeTaskDependencies
70
83
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)
74
84
echo "Publishing with yarn npm publish"
75
85
yarn ./packages/virtualized-lists npm publish --tag $(publishTag)
76
86
yarn ./packages/react-native npm publish --tag $(publishTag)
77
87
else
78
88
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) )
81
91
fi
82
92
fi
83
93
displayName: Publish packages
0 commit comments