-
Notifications
You must be signed in to change notification settings - Fork 50.4k
Skip empty sync commits (both repos) #29707
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
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -10,7 +10,36 @@ jobs: | |
| outputs: | ||
| www_branch_count: ${{ steps.check_branches.outputs.www_branch_count }} | ||
| fbsource_branch_count: ${{ steps.check_branches.outputs.fbsource_branch_count }} | ||
| last_version_classic: ${{ steps.get_last_version_www.outputs.last_version_classic }} | ||
| last_version_modern: ${{ steps.get_last_version_www.outputs.last_version_modern }} | ||
| last_version_rn: ${{ steps.get_last_version_rn.outputs.last_version_rn }} | ||
| current_version_classic: ${{ steps.get_current_version.outputs.current_version_classic }} | ||
| current_version_modern: ${{ steps.get_current_version.outputs.current_version_modern }} | ||
| current_version_rn: ${{ steps.get_current_version.outputs.current_version_rn }} | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
| with: | ||
| ref: builds/facebook-www | ||
| - name: "Get last version string for www" | ||
| id: get_last_version_www | ||
| run: | | ||
| # Empty checks only needed for backwards compatibility,can remove later. | ||
| VERSION_CLASSIC=$( [ -f ./compiled/facebook-www/VERSION_CLASSIC ] && cat ./compiled/facebook-www/VERSION_CLASSIC || echo '' ) | ||
| VERSION_MODERN=$( [ -f ./compiled/facebook-www/VERSION_MODERN ] && cat ./compiled/facebook-www/VERSION_MODERN || echo '' ) | ||
| echo "Last classic version is $VERSION_CLASSIC" | ||
| echo "Last modern version is $VERSION_MODERN" | ||
| echo "last_version_classic=$VERSION_CLASSIC" >> "$GITHUB_OUTPUT" | ||
| echo "last_version_modern=$VERSION_MODERN" >> "$GITHUB_OUTPUT" | ||
| - uses: actions/checkout@v4 | ||
| with: | ||
| ref: builds/facebook-fbsource | ||
| - name: "Get last version string for rn" | ||
| id: get_last_version_rn | ||
| run: | | ||
| # Empty checks only needed for backwards compatibility,can remove later. | ||
| VERSION_NATIVE_FB=$( [ -f ./compiled-rn/VERSION_NATIVE_FB ] && cat ./compiled-rn/VERSION_NATIVE_FB || echo '' ) | ||
| echo "Last rn version is $VERSION_NATIVE_FB" | ||
| echo "last_version_rn=$VERSION_NATIVE_FB" >> "$GITHUB_OUTPUT" | ||
| - uses: actions/checkout@v4 | ||
| - name: "Check branches" | ||
| id: check_branches | ||
|
|
@@ -160,12 +189,27 @@ jobs: | |
| rm $RENDERER_FOLDER/ReactFabric-{dev,prod,profiling}.js | ||
| rm $RENDERER_FOLDER/ReactNativeRenderer-{dev,prod,profiling}.js | ||
|
|
||
| ls -R ./compiled | ||
| # Move React Native version file | ||
| mv build/facebook-react-native/VERSION_NATIVE_FB ./compiled-rn/VERSION_NATIVE_FB | ||
|
|
||
| ls -R ./compiled-rn | ||
| - name: Add REVISION files | ||
| run: | | ||
| echo ${{ github.sha }} >> ./compiled/facebook-www/REVISION | ||
| cp ./compiled/facebook-www/REVISION ./compiled/facebook-www/REVISION_TRANSFORMS | ||
| echo ${{ github.sha }} >> ./compiled-rn/facebook-fbsource/xplat/js/react-native-github/Libraries/Renderer/REVISION | ||
| - name: "Get current version string" | ||
| id: get_current_version | ||
| run: | | ||
| VERSION_CLASSIC=$(cat ./compiled/facebook-www/VERSION_CLASSIC) | ||
| VERSION_MODERN=$(cat ./compiled/facebook-www/VERSION_MODERN) | ||
| VERSION_NATIVE_FB=$(cat ./compiled-rn/VERSION_NATIVE_FB) | ||
| echo "Current classic version is $VERSION_CLASSIC" | ||
| echo "Current modern version is $VERSION_MODERN" | ||
| echo "Current rn version is $VERSION_NATIVE_FB" | ||
| echo "current_version_classic=$VERSION_CLASSIC" >> "$GITHUB_OUTPUT" | ||
| echo "current_version_modern=$VERSION_MODERN" >> "$GITHUB_OUTPUT" | ||
| echo "current_version_rn=$VERSION_NATIVE_FB" >> "$GITHUB_OUTPUT" | ||
| - uses: actions/upload-artifact@v3 | ||
| with: | ||
| name: compiled | ||
|
|
@@ -189,8 +233,60 @@ jobs: | |
| with: | ||
| name: compiled | ||
| path: compiled/ | ||
| - run: git status -u | ||
| - name: Revert version changes | ||
| if: needs.download_artifacts.outputs.last_version_classic != '' && needs.download_artifacts.outputs.last_version_modern != '' | ||
| env: | ||
| CURRENT_VERSION_CLASSIC: ${{ needs.download_artifacts.outputs.current_version_classic }} | ||
| CURRENT_VERSION_MODERN: ${{ needs.download_artifacts.outputs.current_version_modern }} | ||
| LAST_VERSION_CLASSIC: ${{ needs.download_artifacts.outputs.last_version_classic }} | ||
| LAST_VERSION_MODERN: ${{ needs.download_artifacts.outputs.last_version_modern }} | ||
| run: | | ||
| echo "Reverting $CURRENT_VERSION_CLASSIC to $LAST_VERSION_CLASSIC" | ||
| grep -rl "$CURRENT_VERSION_CLASSIC" ./compiled || echo "No files found with $CURRENT_VERSION_CLASSIC" | ||
| grep -rl "$CURRENT_VERSION_CLASSIC" ./compiled | xargs -r sed -i -e "s/$CURRENT_VERSION_CLASSIC/$LAST_VERSION_CLASSIC/g" | ||
| grep -rl "$CURRENT_VERSION_CLASSIC" ./compiled || echo "Classic version reverted" | ||
| echo "====================" | ||
| echo "Reverting $CURRENT_VERSION_MODERN to $LAST_VERSION_MODERN" | ||
| grep -rl "$CURRENT_VERSION_MODERN" ./compiled || echo "No files found with $CURRENT_VERSION_MODERN" | ||
| grep -rl "$CURRENT_VERSION_MODERN" ./compiled | xargs -r sed -i -e "s/$CURRENT_VERSION_MODERN/$LAST_VERSION_MODERN/g" | ||
| grep -rl "$CURRENT_VERSION_MODERN" ./compiled || echo "Modern version reverted" | ||
| - name: Check if only the REVISION file has changed | ||
| id: check_should_commit | ||
| run: | | ||
| echo "Full git status" | ||
| git status | ||
| echo "====================" | ||
| if git status --porcelain | grep -qv '/REVISION'; then | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. How come you have
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The www file is |
||
| echo "Changes detected" | ||
| echo "should_commit=true" >> "$GITHUB_OUTPUT" | ||
| else | ||
| echo "No Changes detected" | ||
| echo "should_commit=false" >> "$GITHUB_OUTPUT" | ||
| fi | ||
| - name: Re-apply version changes | ||
| if: steps.check_should_commit.outputs.should_commit == 'true' && needs.download_artifacts.outputs.last_version_classic != '' && needs.download_artifacts.outputs.last_version_modern != '' | ||
| env: | ||
| CURRENT_VERSION_CLASSIC: ${{ needs.download_artifacts.outputs.current_version_classic }} | ||
| CURRENT_VERSION_MODERN: ${{ needs.download_artifacts.outputs.current_version_modern }} | ||
| LAST_VERSION_CLASSIC: ${{ needs.download_artifacts.outputs.last_version_classic }} | ||
| LAST_VERSION_MODERN: ${{ needs.download_artifacts.outputs.last_version_modern }} | ||
| run: | | ||
| echo "Re-applying $LAST_VERSION_CLASSIC to $CURRENT_VERSION_CLASSIC" | ||
| grep -rl "$LAST_VERSION_CLASSIC" ./compiled || echo "No files found with $LAST_VERSION_CLASSIC" | ||
| grep -rl "$LAST_VERSION_CLASSIC" ./compiled | xargs -r sed -i -e "s/$LAST_VERSION_CLASSIC/$CURRENT_VERSION_CLASSIC/g" | ||
| grep -rl "$LAST_VERSION_CLASSIC" ./compiled || echo "Classic version re-applied" | ||
| echo "====================" | ||
| echo "Re-applying $LAST_VERSION_MODERN to $CURRENT_VERSION_MODERN" | ||
| grep -rl "$LAST_VERSION_MODERN" ./compiled || echo "No files found with $LAST_VERSION_MODERN" | ||
| grep -rl "$LAST_VERSION_MODERN" ./compiled | xargs -r sed -i -e "s/$LAST_VERSION_MODERN/$CURRENT_VERSION_MODERN/g" | ||
| grep -rl "$LAST_VERSION_MODERN" ./compiled || echo "Classic version re-applied" | ||
| - name: Will commit these changes | ||
| if: steps.check_should_commit.outputs.should_commit == 'true' | ||
| run: | | ||
| echo ":" | ||
| git status -u | ||
| - name: Commit changes to branch | ||
| if: false && steps.check_should_commit.outputs.should_commit == 'true' | ||
| uses: stefanzweifel/git-auto-commit-action@v4 | ||
| with: | ||
| commit_message: | | ||
|
|
@@ -211,13 +307,52 @@ jobs: | |
| with: | ||
| ref: builds/facebook-fbsource | ||
| - name: Ensure clean directory | ||
| run: rm -rf compiled | ||
| run: rm -rf compiled-rn | ||
| - uses: actions/download-artifact@v3 | ||
| with: | ||
| name: compiled-rn | ||
| path: compiled-rn/ | ||
| - run: git status -u | ||
| - name: Revert version changes | ||
| if: needs.download_artifacts.outputs.last_version_rn != '' | ||
| env: | ||
| CURRENT_VERSION: ${{ needs.download_artifacts.outputs.current_version_rn }} | ||
| LAST_VERSION: ${{ needs.download_artifacts.outputs.last_version_rn }} | ||
| run: | | ||
| echo "Reverting $CURRENT_VERSION to $LAST_VERSION" | ||
| grep -rl "$CURRENT_VERSION" ./compiled-rn || echo "No files found with $CURRENT_VERSION" | ||
| grep -rl "$CURRENT_VERSION" ./compiled-rn | xargs -r sed -i -e "s/$CURRENT_VERSION/$LAST_VERSION/g" | ||
| grep -rl "$CURRENT_VERSION" ./compiled-rn || echo "Version reverted" | ||
| - name: Check if only the REVISION file has changed | ||
| id: check_should_commit | ||
| run: | | ||
| echo "Full git status" | ||
| git status | ||
| echo "====================" | ||
| echo "Checking for changes" | ||
| if git status --porcelain | grep -qv '/REVISION'; then | ||
| echo "Changes detected" | ||
| echo "should_commit=true" >> "$GITHUB_OUTPUT" | ||
| else | ||
| echo "No Changes detected" | ||
| echo "should_commit=false" >> "$GITHUB_OUTPUT" | ||
| fi | ||
| - name: Re-apply version changes | ||
| if: steps.check_should_commit.outputs.should_commit == 'true' && needs.download_artifacts.outputs.last_version_rn != '' | ||
| env: | ||
| CURRENT_VERSION: ${{ needs.download_artifacts.outputs.current_version_rn }} | ||
| LAST_VERSION: ${{ needs.download_artifacts.outputs.last_version_rn }} | ||
| run: | | ||
| echo "Re-applying $LAST_VERSION to $CURRENT_VERSION" | ||
| grep -rl "$LAST_VERSION" ./compiled-rn || echo "No files found with $LAST_VERSION" | ||
| grep -rl "$LAST_VERSION" ./compiled-rn | xargs -r sed -i -e "s/$LAST_VERSION/$CURRENT_VERSION/g" | ||
| grep -rl "$LAST_VERSION" ./compiled-rn || echo "Version re-applied" | ||
| - name: Will commit these changes | ||
| if: steps.check_should_commit.outputs.should_commit == 'true' | ||
| run: | | ||
| echo ":" | ||
| git status -u | ||
| - name: Commit changes to branch | ||
| if: steps.check_should_commit.outputs.should_commit == 'true' | ||
| uses: stefanzweifel/git-auto-commit-action@v4 | ||
| with: | ||
| commit_message: | | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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.
Uh oh!
There was an error while loading. Please reload this page.