8282 working-directory : scripts/release
8383 - name : Download artifacts for base revision
8484 run : |
85- GH_TOKEN=${{ github.token }} scripts/release/download-experimental-build.js --commit=${{ inputs.commit_sha || github.event.workflow_run.head_sha }}
85+ GH_TOKEN=${{ github.token }} scripts/release/download-experimental-build.js --commit=${{ inputs.commit_sha || github.event.workflow_run.head_sha || github.sha }}
8686 - name : Display structure of build
8787 run : ls -R build
8888 - name : Strip @license from eslint plugin and react-refresh
@@ -145,9 +145,9 @@ jobs:
145145 ls -R ./compiled-rn
146146 - name : Add REVISION files
147147 run : |
148- echo ${{ github.event.workflow_run.head_sha }} >> ./compiled/facebook-www/REVISION
148+ echo ${{ github.sha }} >> ./compiled/facebook-www/REVISION
149149 cp ./compiled/facebook-www/REVISION ./compiled/facebook-www/REVISION_TRANSFORMS
150- echo ${{ github.event.workflow_run.head_sha }} >> ./compiled-rn/facebook-fbsource/xplat/js/react-native-github/Libraries/Renderer/REVISION
150+ echo ${{ github.sha }} >> ./compiled-rn/facebook-fbsource/xplat/js/react-native-github/Libraries/Renderer/REVISION
151151 - name : " Get current version string"
152152 id : get_current_version
153153 run : |
@@ -171,7 +171,7 @@ jobs:
171171
172172 commit_www_artifacts :
173173 needs : download_artifacts
174- if : ${{ (github.ref == 'refs/heads/main' && needs.download_artifacts.outputs.www_branch_count == '0') || github.ref == 'refs/heads/meta-www' }}
174+ if : inputs.force == true || (github.ref == 'refs/heads/main' && needs.download_artifacts.outputs.www_branch_count == '0')
175175 runs-on : ubuntu-latest
176176 steps :
177177 - uses : actions/checkout@v4
@@ -201,7 +201,7 @@ jobs:
201201 grep -rl "$CURRENT_VERSION_MODERN" ./compiled | xargs -r sed -i -e "s/$CURRENT_VERSION_MODERN/$LAST_VERSION_MODERN/g"
202202 grep -rl "$CURRENT_VERSION_MODERN" ./compiled || echo "Modern version reverted"
203203 - name : Check for changes
204- if : ! inputs.force
204+ if : inputs.force != true
205205 id : check_should_commit
206206 run : |
207207 echo "Full git status"
@@ -219,7 +219,7 @@ jobs:
219219 echo "should_commit=false" >> "$GITHUB_OUTPUT"
220220 fi
221221 - name : Re-apply version changes
222- if : inputs.force || (steps.check_should_commit.outputs.should_commit == 'true' && needs.download_artifacts.outputs.last_version_classic != '' && needs.download_artifacts.outputs.last_version_modern != '')
222+ if : inputs.force == true || (steps.check_should_commit.outputs.should_commit == 'true' && needs.download_artifacts.outputs.last_version_classic != '' && needs.download_artifacts.outputs.last_version_modern != '')
223223 env :
224224 CURRENT_VERSION_CLASSIC : ${{ needs.download_artifacts.outputs.current_version_classic }}
225225 CURRENT_VERSION_MODERN : ${{ needs.download_artifacts.outputs.current_version_modern }}
@@ -236,26 +236,26 @@ jobs:
236236 grep -rl "$LAST_VERSION_MODERN" ./compiled | xargs -r sed -i -e "s/$LAST_VERSION_MODERN/$CURRENT_VERSION_MODERN/g"
237237 grep -rl "$LAST_VERSION_MODERN" ./compiled || echo "Classic version re-applied"
238238 - name : Will commit these changes
239- if : inputs.force || steps.check_should_commit.outputs.should_commit == 'true'
239+ if : inputs.force == true || steps.check_should_commit.outputs.should_commit == 'true'
240240 run : |
241241 echo ":"
242242 git status -u
243243 - name : Commit changes to branch
244- if : inputs.force || steps.check_should_commit.outputs.should_commit == 'true'
245- uses : stefanzweifel/git-auto-commit-action@v4
244+ if : inputs.force == true || steps.check_should_commit.outputs.should_commit == 'true'
245+ uses : stefanzweifel/git-auto-commit-action@v5
246246 with :
247247 commit_message : |
248- ${{ github.event.workflow_run.head_commit.message }}
248+ ${{ github.event.workflow_run.head_commit.message || format('Manual build of {0}', github.event.workflow_run.head_sha || github.sha) }}
249249
250- DiffTrain build for [${{ github.event.workflow_run.head_sha }}](https://github.com/facebook/react/commit/${{ github.event.workflow_run.head_sha }})
250+ DiffTrain build for [${{ github.event.workflow_run.head_sha || github.sha }}](https://github.com/facebook/react/commit/${{ github.event.workflow_run.head_sha || github.sha }})
251251 branch : builds/facebook-www
252- commit_user_name : ${{ github.event.workflow_run. triggering_actor.login }}
253- commit_user_email : ${{ github.event.workflow_run.triggering_actor.email || format('{0}@users.noreply.github.com', github.event.workflow_run. triggering_actor.login ) }}
252+ commit_user_name : ${{ github.triggering_actor }}
253+ commit_user_email : ${{ format('{0}@users.noreply.github.com', github.triggering_actor) }}
254254 create_branch : true
255255
256256 commit_fbsource_artifacts :
257257 needs : download_artifacts
258- if : ${{ (github.ref == 'refs/heads/main' && needs.download_artifacts.outputs.fbsource_branch_count == '0') || github.ref == 'refs/heads/meta-fbsource' }}
258+ if : inputs.force == true || (github.ref == 'refs/heads/main' && needs.download_artifacts.outputs.fbsource_branch_count == '0')
259259 runs-on : ubuntu-latest
260260 steps :
261261 - uses : actions/checkout@v4
@@ -278,7 +278,7 @@ jobs:
278278 grep -rl "$CURRENT_VERSION" ./compiled-rn | xargs -r sed -i -e "s/$CURRENT_VERSION/$LAST_VERSION/g"
279279 grep -rl "$CURRENT_VERSION" ./compiled-rn || echo "Version reverted"
280280 - name : Check for changes
281- if : ! inputs.force
281+ if : inputs.force != 'true'
282282 id : check_should_commit
283283 run : |
284284 echo "Full git status"
@@ -297,7 +297,7 @@ jobs:
297297 echo "should_commit=false" >> "$GITHUB_OUTPUT"
298298 fi
299299 - name : Re-apply version changes
300- if : inputs.force || (steps.check_should_commit.outputs.should_commit == 'true' && needs.download_artifacts.outputs.last_version_rn != '')
300+ if : inputs.force == true || (steps.check_should_commit.outputs.should_commit == 'true' && needs.download_artifacts.outputs.last_version_rn != '')
301301 env :
302302 CURRENT_VERSION : ${{ needs.download_artifacts.outputs.current_version_rn }}
303303 LAST_VERSION : ${{ needs.download_artifacts.outputs.last_version_rn }}
@@ -307,12 +307,12 @@ jobs:
307307 grep -rl "$LAST_VERSION" ./compiled-rn | xargs -r sed -i -e "s/$LAST_VERSION/$CURRENT_VERSION/g"
308308 grep -rl "$LAST_VERSION" ./compiled-rn || echo "Version re-applied"
309309 - name : Add files for signing
310- if : inputs.force || steps.check_should_commit.outputs.should_commit == 'true'
310+ if : inputs.force == true || steps.check_should_commit.outputs.should_commit == 'true'
311311 run : |
312312 echo ":"
313313 git add .
314314 - name : Signing files
315- if : inputs.force || steps.check_should_commit.outputs.should_commit == 'true'
315+ if : inputs.force == true || steps.check_should_commit.outputs.should_commit == 'true'
316316 uses : actions/github-script@v7
317317 with :
318318 script : |
@@ -366,8 +366,9 @@ jobs:
366366 console.log('Signing files in directory:', directory);
367367 try {
368368 const result = execSync(`git status --porcelain ${directory}`, {encoding: 'utf8'});
369+ console.log(result);
369370
370- // Parse the git status output to get file paths
371+ // Parse the git status output to get file paths!
371372 const files = result.split('\n').filter(file => file.endsWith('.js'));
372373
373374 if (files.length === 0) {
@@ -376,7 +377,14 @@ jobs:
376377 );
377378 } else {
378379 files.forEach(line => {
379- const file = line.slice(3).trim();
380+ let file = null;
381+ if (line.startsWith('D ')) {
382+ return;
383+ } else if (line.startsWith('R ')) {
384+ file = line.slice(line.indexOf('->') + 3);
385+ } else {
386+ file = line.slice(3).trim();
387+ }
380388 if (file) {
381389 console.log(' Signing file:', file);
382390 const originalContents = fs.readFileSync(file, 'utf8');
@@ -395,19 +403,19 @@ jobs:
395403 console.error('Error signing files:', e);
396404 }
397405 - name : Will commit these changes
398- if : inputs.force || steps.check_should_commit.outputs.should_commit == 'true'
406+ if : inputs.force == true || steps.check_should_commit.outputs.should_commit == 'true'
399407 run : |
400408 git add .
401409 git status
402410 - name : Commit changes to branch
403- if : inputs.force || steps.check_should_commit.outputs.should_commit == 'true'
404- uses : stefanzweifel/git-auto-commit-action@v4
411+ if : inputs.force == true || steps.check_should_commit.outputs.should_commit == 'true'
412+ uses : stefanzweifel/git-auto-commit-action@v5
405413 with :
406414 commit_message : |
407- ${{ github.event.workflow_run.head_commit.message }}
415+ ${{ github.event.workflow_run.head_commit.message || format('Manual build of {0}', github.event.workflow_run.head_sha || github.sha) }}
408416
409- DiffTrain build for commit https://github.com/facebook/react/commit/${{ github.event.workflow_run.head_sha }}.
417+ DiffTrain build for [${{ github.event.workflow_run.head_sha || github.sha }}]( https://github.com/facebook/react/commit/${{ github.event.workflow_run.head_sha || github.sha }})
410418 branch : builds/facebook-fbsource
411- commit_user_name : ${{ github.event.workflow_run. triggering_actor.login }}
412- commit_user_email : ${{ github.event.workflow_run.triggering_actor.email || format('{0}@users.noreply.github.com', github.event.workflow_run. triggering_actor.login ) }}
419+ commit_user_name : ${{ github.triggering_actor }}
420+ commit_user_email : ${{ format('{0}@users.noreply.github.com', github.triggering_actor) }}
413421 create_branch : true
0 commit comments