Skip to content

Commit 1cd2eed

Browse files
Saadnajmitido64
andauthored
ci(0.77): backport publish pipeline changes (#2443)
## Summary: Backport #2422 , #2432 , and #2434 to 0.77-stable ## Test Plan: CI should pass --------- Co-authored-by: Tommy Nguyen <[email protected]>
1 parent 5f34242 commit 1cd2eed

File tree

2 files changed

+14
-6
lines changed

2 files changed

+14
-6
lines changed

.ado/scripts/prepublish-check.mjs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -218,10 +218,11 @@ function enablePublishing(config, currentBranch, { npmTag: tag, prerelease, isNe
218218
// Determines whether we need to add "nightly" or "rc" to the version string.
219219
const { generatorOptions } = release.version;
220220
if (generatorOptions.preid !== prerelease) {
221-
errors.push(`'release.version.generatorOptions.preid' must be set to '${prerelease || ""}'`);
222221
if (prerelease) {
222+
errors.push(`'release.version.generatorOptions.preid' must be set to '${prerelease}'`);
223223
generatorOptions.preid = prerelease;
224224
} else {
225+
errors.push(`'release.version.generatorOptions.preid' must be removed`);
225226
generatorOptions.preid = undefined;
226227
}
227228
}

.ado/templates/npm-publish-steps.yml

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,12 +21,19 @@ steps:
2121
2222
- script: |
2323
git switch $(Build.SourceBranchName)
24-
echo "//registry.npmjs.org/:_authToken=$(NODE_AUTH_TOKEN)" > ~/.npmrc
2524
yarn nx release --skip-publish --verbose
26-
yarn nx release publish --excludeTaskDependencies
27-
rm ~/.npmrc
2825
env:
2926
GITHUB_TOKEN: $(githubAuthToken)
30-
NODE_AUTH_TOKEN: $(npmAuthToken)
31-
displayName: Version and publish packages
27+
displayName: Version Packages and Github Release
3228
condition: and(succeeded(), eq(variables['publish_react_native_macos'], '1'))
29+
30+
- script: |
31+
echo "//registry.npmjs.org/:_authToken=$(npmAuthToken)" > ~/.npmrc
32+
yarn nx release publish --excludeTaskDependencies
33+
displayName: Publish packages
34+
condition: and(succeeded(), eq(variables['publish_react_native_macos'], '1'))
35+
36+
- script: |
37+
rm -f ~/.npmrc
38+
displayName: Remove npmrc if it exists
39+
condition: always()

0 commit comments

Comments
 (0)