@@ -585,9 +585,10 @@ jobs:
585585 RELEASE_CHANNEL : experimental
586586
587587 # ----- SIZEBOT -----
588- download_base_build_for_sizebot :
589- if : ${{ github.event_name == 'pull_request' && github.ref_name != 'main' }}
590- name : Download base build for sizebot
588+ sizebot :
589+ if : ${{ github.event_name == 'pull_request' && github.ref_name != 'main' && github.event.pull_request.base.ref == 'main' }}
590+ name : Run sizebot
591+ needs : [build_and_lint]
591592 runs-on : ubuntu-latest
592593 steps :
593594 - uses : actions/checkout@v4
@@ -603,50 +604,23 @@ jobs:
603604 id : node_modules
604605 with :
605606 path : " **/node_modules"
606- key : ${{ runner.arch }}-${{ runner.os }}-modules- ${{ hashFiles('yarn.lock', 'scripts/release/ yarn.lock') }}
607+ key : runtime-node_modules- ${{ runner.arch }}-${{ runner.os }}-${{ hashFiles('yarn.lock') }}
607608 - name : Ensure clean build directory
608609 run : rm -rf build
609- - run : yarn install --frozen-lockfile
610610 - run : yarn install --frozen-lockfile
611611 working-directory : scripts/release
612612 - name : Download artifacts for base revision
613613 run : |
614- git fetch origin main
615- GH_TOKEN=${{ github.token }} scripts/release/download-experimental-build.js --commit=$(git rev-parse origin/main)
614+ GH_TOKEN=${{ github.token }} scripts/release/download-experimental-build.js --commit=$(git rev-parse ${{ github.event.pull_request.base.sha }})
616615 mv ./build ./base-build
617616 # TODO: The `download-experimental-build` script copies the npm
618617 # packages into the `node_modules` directory. This is a historical
619618 # quirk of how the release script works. Let's pretend they
620619 # don't exist.
621620 - name : Delete extraneous files
622621 run : rm -rf ./base-build/node_modules
623- - name : Display structure of base-build
622+ - name : Display structure of base-build from origin/main
624623 run : ls -R base-build
625- - name : Archive base-build
626- uses : actions/upload-artifact@v4
627- with :
628- name : base-build
629- path : base-build
630-
631- sizebot :
632- name : Run sizebot
633- needs : [build_and_lint, download_base_build_for_sizebot]
634- runs-on : ubuntu-latest
635- steps :
636- - uses : actions/checkout@v4
637- with :
638- ref : ${{ github.event.pull_request.head.sha || github.sha }}
639- - uses : actions/setup-node@v4
640- with :
641- node-version-file : ' .nvmrc'
642- cache : yarn
643- cache-dependency-path : yarn.lock
644- - name : Restore cached node_modules
645- uses : actions/cache@v4
646- id : node_modules
647- with :
648- path : " **/node_modules"
649- key : runtime-node_modules-${{ runner.arch }}-${{ runner.os }}-${{ hashFiles('yarn.lock') }}
650624 - name : Ensure clean build directory
651625 run : rm -rf build
652626 - run : yarn install --frozen-lockfile
@@ -662,13 +636,6 @@ jobs:
662636 node ./scripts/print-warnings/print-warnings.js > build/__test_utils__/ReactAllWarnings.js
663637 - name : Display structure of build for PR
664638 run : ls -R build
665- - name : Restore archived base-build from origin/main
666- uses : actions/download-artifact@v4
667- with :
668- name : base-build
669- path : base-build
670- - name : Display structure of base-build from origin/main
671- run : ls -R base-build
672639 - run : echo ${{ github.sha }} >> build/COMMIT_SHA
673640 - run : node ./scripts/tasks/danger
674641 - name : Archive sizebot results
0 commit comments