Skip to content

Commit c57b90f

Browse files
authored
[DiffTrain] Add artifacts for React Native to compiled (#26204)
1 parent 842bd78 commit c57b90f

File tree

1 file changed

+53
-3
lines changed

1 file changed

+53
-3
lines changed

.github/workflows/commit_artifacts.yml

Lines changed: 53 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Commit Artifacts for Facebook WWW
1+
name: Commit Artifacts for Facebook WWW and fbsource
22

33
on:
44
push:
@@ -108,7 +108,7 @@ jobs:
108108
sed -i -e 's/ @license React*//' \
109109
build/oss-experimental/eslint-plugin-react-hooks/cjs/eslint-plugin-react-hooks.development.js \
110110
build/oss-experimental/react-refresh/cjs/react-refresh-babel.development.js
111-
- name: Move relevant files into compiled
111+
- name: Move relevant files for React in www into compiled
112112
run: |
113113
mkdir -p ./compiled
114114
mkdir -p ./compiled/facebook-www
@@ -132,6 +132,26 @@ jobs:
132132
mv build/oss-experimental/react-refresh/cjs/react-refresh-babel.development.js \
133133
./compiled/babel-plugin-react-refresh/index.js
134134
135+
ls -R ./compiled
136+
- name: Move relevant files for React in fbsource into compiled-rn
137+
run: |
138+
BASE_FOLDER='compiled-rn/facebook-fbsource/xplat/js'
139+
mkdir -p ${BASE_FOLDER}/react-native-github/Libraries/Renderer/
140+
mkdir -p ${BASE_FOLDER}/RKJSModules/vendor/{scheduler,react,react-is,react-test-renderer}/
141+
142+
# Move React Native renderer
143+
mv build/react-native/implementations/ $BASE_FOLDER/react-native-github/Libraries/Renderer/
144+
mv build/react-native/shims/ $BASE_FOLDER/react-native-github/Libraries/Renderer/
145+
mv build/facebook-react-native/scheduler/cjs/ $BASE_FOLDER/RKJSModules/vendor/scheduler/
146+
mv build/facebook-react-native/react/cjs/ $BASE_FOLDER/RKJSModules/vendor/react/
147+
mv build/facebook-react-native/react-is/cjs/ $BASE_FOLDER/RKJSModules/vendor/react-is/
148+
mv build/facebook-react-native/react-test-renderer/cjs/ $BASE_FOLDER/RKJSModules/vendor/react-test-renderer/
149+
150+
# Delete OSS renderer. OSS renderer is synced through internal script.
151+
RENDERER_FOLDER=$BASE_FOLDER/react-native-github/Libraries/Renderer/implementations/
152+
rm $RENDERER_FOLDER/ReactFabric-{dev,prod,profiling}.js
153+
rm $RENDERER_FOLDER/ReactNativeRenderer-{dev,prod,profiling}.js
154+
135155
ls -R ./compiled
136156
- name: Add REVISION file
137157
run: |
@@ -140,8 +160,12 @@ jobs:
140160
with:
141161
name: compiled
142162
path: compiled/
163+
- uses: actions/upload-artifact@v3
164+
with:
165+
name: compiled-rn
166+
path: compiled-rn/
143167

144-
commit_artifacts:
168+
commit_www_artifacts:
145169
needs: download_artifacts
146170
runs-on: ubuntu-latest
147171
steps:
@@ -175,3 +199,29 @@ jobs:
175199
commit_user_name: ${{ github.actor }}
176200
commit_user_email: ${{ github.actor }}@users.noreply.github.com
177201
create_branch: true
202+
203+
commit_fbsource_artifacts:
204+
needs: download_artifacts
205+
runs-on: ubuntu-latest
206+
steps:
207+
- uses: actions/checkout@v3
208+
with:
209+
ref: main
210+
repository: facebook/react-fbsource-import
211+
token: ${{secrets.FBSOURCE_SYNC_PUSH_TOKEN}}
212+
- name: Ensure clean directory
213+
run: rm -rf compiled-rn
214+
- uses: actions/download-artifact@v3
215+
with:
216+
name: compiled-rn
217+
path: compiled-rn/
218+
- run: git status -u
219+
- name: Commit changes to branch
220+
uses: stefanzweifel/git-auto-commit-action@v4
221+
with:
222+
commit_message: |
223+
${{ github.event.head_commit.message }}
224+
225+
DiffTrain build for commit https://github.com/facebook/react/commit/${{ github.sha }}.
226+
commit_user_name: ${{ github.actor }}
227+
commit_user_email: ${{ github.actor }}@users.noreply.github.com

0 commit comments

Comments
 (0)