Skip to content

Commit

Permalink
[DiffTrain] Add artifacts for React Native to compiled (facebook#26204)
Browse files Browse the repository at this point in the history
  • Loading branch information
sammy-SC authored Mar 20, 2023
1 parent 842bd78 commit c57b90f
Showing 1 changed file with 53 additions and 3 deletions.
56 changes: 53 additions & 3 deletions .github/workflows/commit_artifacts.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Commit Artifacts for Facebook WWW
name: Commit Artifacts for Facebook WWW and fbsource

on:
push:
Expand Down Expand Up @@ -108,7 +108,7 @@ jobs:
sed -i -e 's/ @license React*//' \
build/oss-experimental/eslint-plugin-react-hooks/cjs/eslint-plugin-react-hooks.development.js \
build/oss-experimental/react-refresh/cjs/react-refresh-babel.development.js
- name: Move relevant files into compiled
- name: Move relevant files for React in www into compiled
run: |
mkdir -p ./compiled
mkdir -p ./compiled/facebook-www
Expand All @@ -132,6 +132,26 @@ jobs:
mv build/oss-experimental/react-refresh/cjs/react-refresh-babel.development.js \
./compiled/babel-plugin-react-refresh/index.js
ls -R ./compiled
- name: Move relevant files for React in fbsource into compiled-rn
run: |
BASE_FOLDER='compiled-rn/facebook-fbsource/xplat/js'
mkdir -p ${BASE_FOLDER}/react-native-github/Libraries/Renderer/
mkdir -p ${BASE_FOLDER}/RKJSModules/vendor/{scheduler,react,react-is,react-test-renderer}/
# Move React Native renderer
mv build/react-native/implementations/ $BASE_FOLDER/react-native-github/Libraries/Renderer/
mv build/react-native/shims/ $BASE_FOLDER/react-native-github/Libraries/Renderer/
mv build/facebook-react-native/scheduler/cjs/ $BASE_FOLDER/RKJSModules/vendor/scheduler/
mv build/facebook-react-native/react/cjs/ $BASE_FOLDER/RKJSModules/vendor/react/
mv build/facebook-react-native/react-is/cjs/ $BASE_FOLDER/RKJSModules/vendor/react-is/
mv build/facebook-react-native/react-test-renderer/cjs/ $BASE_FOLDER/RKJSModules/vendor/react-test-renderer/
# Delete OSS renderer. OSS renderer is synced through internal script.
RENDERER_FOLDER=$BASE_FOLDER/react-native-github/Libraries/Renderer/implementations/
rm $RENDERER_FOLDER/ReactFabric-{dev,prod,profiling}.js
rm $RENDERER_FOLDER/ReactNativeRenderer-{dev,prod,profiling}.js
ls -R ./compiled
- name: Add REVISION file
run: |
Expand All @@ -140,8 +160,12 @@ jobs:
with:
name: compiled
path: compiled/
- uses: actions/upload-artifact@v3
with:
name: compiled-rn
path: compiled-rn/

commit_artifacts:
commit_www_artifacts:
needs: download_artifacts
runs-on: ubuntu-latest
steps:
Expand Down Expand Up @@ -175,3 +199,29 @@ jobs:
commit_user_name: ${{ github.actor }}
commit_user_email: ${{ github.actor }}@users.noreply.github.com
create_branch: true

commit_fbsource_artifacts:
needs: download_artifacts
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
ref: main
repository: facebook/react-fbsource-import
token: ${{secrets.FBSOURCE_SYNC_PUSH_TOKEN}}
- name: Ensure clean directory
run: rm -rf compiled-rn
- uses: actions/download-artifact@v3
with:
name: compiled-rn
path: compiled-rn/
- run: git status -u
- name: Commit changes to branch
uses: stefanzweifel/git-auto-commit-action@v4
with:
commit_message: |
${{ github.event.head_commit.message }}
DiffTrain build for commit https://github.com/facebook/react/commit/${{ github.sha }}.
commit_user_name: ${{ github.actor }}
commit_user_email: ${{ github.actor }}@users.noreply.github.com

0 comments on commit c57b90f

Please sign in to comment.