@samitouri / QOS-React-2 / commits / c57b90f50d

[DiffTrain] Add artifacts for React Native to compiled (#26204)

Samuel Susla committed Mar 20, 2023 at 11:23 UTC c57b90f50d3b7d643e2f8ae16cf22ae1861bc19e
1 file changed +53 -3
.github/workflows/commit_artifacts.yml
+53 -3
@@ -1,4 +1,4 @@
1 -name: Commit Artifacts for Facebook WWW
1 +name: Commit Artifacts for Facebook WWW and fbsource
2
3 on:
4 push:
@@ -108,7 +108,7 @@ jobs:
108 sed -i -e 's/ @license React*//' \
109 build/oss-experimental/eslint-plugin-react-hooks/cjs/eslint-plugin-react-hooks.development.js \
110 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
112 run: |
113 mkdir -p ./compiled
114 mkdir -p ./compiled/facebook-www
@@ -132,6 +132,26 @@ jobs:
132 mv build/oss-experimental/react-refresh/cjs/react-refresh-babel.development.js \
133 ./compiled/babel-plugin-react-refresh/index.js
134
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 +
155 ls -R ./compiled
156 - name: Add REVISION file
157 run: |
@@ -140,8 +160,12 @@ jobs:
160 with:
161 name: compiled
162 path: compiled/
163 + - uses: actions/upload-artifact@v3
164 + with:
165 + name: compiled-rn
166 + path: compiled-rn/
167
144 - commit_artifacts:
168 + commit_www_artifacts:
169 needs: download_artifacts
170 runs-on: ubuntu-latest
171 steps:
@@ -175,3 +199,29 @@ jobs:
199 commit_user_name: ${{ github.actor }}
200 commit_user_email: ${{ github.actor }}@users.noreply.github.com
201 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