Refactor publish pipeline (Take 4) #1777
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Please select one of the following
Summary
We still had NPM publish problems... and after lots of testing, I believe I have found the fix.
The previous refactors attempted to use the nodejs scripts from React Native Core to perform tasks like
git tag
,git push
, andnpm publish
. However, for whatever reason when those scripts are run in Azure Pipelines, they don't have access our secrets (AKA:githubAuthToken
, andnpmAuthToken
), and those steps would always fail. This is partially because (as I learned), you must explicitly pass secrets down to each individual step as an environment variable, even if they're already set elsewhere (soemthing about scoping of variables to individual tasks..).So now, we do the following:
prepare-package-for-release.js
as a dry-run so it skips thegit tag / git push
phasenpm publish
frompublish-npm.js
.ado/publish.yml
that do thegit tag / git push / npm publish
instead. This involved bringing back some files I had deleted in earlier takes of the refactor 😅..ado/configure-git.yml
to give rnbot push permissions as that was missing. This is taken from [0.68.69] Bump version numbers #1776..ado/publish.yml
so hopefully the git history is less confusing 🥲Changelog
[INTERNAL] [FIXED] - Refactor publish pipeline (Take 4)
Test Plan
I ran these changes (with some modifications to fake the branch name / release type) and successfully published both a nightly and
0.71.0
to NPM. I also tested thegit push
bit by seeing if I I could have rnbot push to a test branch.