Skip to content
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

Refactor Publish pipeline (take 2) #1773

Merged
merged 4 commits into from
Apr 4, 2023
Merged

Conversation

Saadnajmi
Copy link
Collaborator

@Saadnajmi Saadnajmi commented Apr 3, 2023

Please select one of the following

  • I am removing an existing difference between facebook/react-native and microsoft/react-native-macos 👍
  • I am cherry-picking a change from Facebook's react-native into microsoft/react-native-macos 👍
  • I am making a fix / change for the macOS implementation of react-native
  • I am making a change required for Microsoft usage of react-native

Summary

#1771 merged prematurely... so here's take 2.

This change refactors both our NPM Publish and NPM Publish Dry Run jobs to be much more correct, readable, and actually work. Namely, there's a few big changes:

  1. Move the checking of what branch we're on to the top level vars.yml with nice names like isMain and isReleaseBranch so it's a lot easier to reason about
  2. Create a new template apple-job-publish that contains most of the publish steps with a parameter for "build-type"
  • This way, we can extract any references to the Branch name from these steps, and instead focus on the intent: what "type" of build/release are we publishing?
  1. Use that template for both our PR check ("NPM Publish Dry Run") and our publish job
  • With the variables we defined earlier (isMain and isReleaseBranch), it's now very easy to reason if we're doing a nightly or a release build.

All in all, very happy with this refactor :)

Changelog

[GENERAL] [FIXED] - Fix publish (attempt 2)

Test Plan

CI should pass

@Saadnajmi Saadnajmi changed the title Fix publish (attempt 2) Refactor Publish pipeline (take 2) Apr 4, 2023
@Saadnajmi Saadnajmi marked this pull request as ready for review April 4, 2023 01:25
@Saadnajmi Saadnajmi requested a review from a team as a code owner April 4, 2023 01:25
@Saadnajmi Saadnajmi merged commit d02bce5 into microsoft:main Apr 4, 2023
@Saadnajmi Saadnajmi deleted the fix-try-2 branch April 4, 2023 17:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants