@@ -585,9 +585,10 @@ jobs:
585
585
RELEASE_CHANNEL : experimental
586
586
587
587
# ----- 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]
591
592
runs-on : ubuntu-latest
592
593
steps :
593
594
- uses : actions/checkout@v4
@@ -603,50 +604,23 @@ jobs:
603
604
id : node_modules
604
605
with :
605
606
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') }}
607
608
- name : Ensure clean build directory
608
609
run : rm -rf build
609
- - run : yarn install --frozen-lockfile
610
610
- run : yarn install --frozen-lockfile
611
611
working-directory : scripts/release
612
612
- name : Download artifacts for base revision
613
613
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 }})
616
615
mv ./build ./base-build
617
616
# TODO: The `download-experimental-build` script copies the npm
618
617
# packages into the `node_modules` directory. This is a historical
619
618
# quirk of how the release script works. Let's pretend they
620
619
# don't exist.
621
620
- name : Delete extraneous files
622
621
run : rm -rf ./base-build/node_modules
623
- - name : Display structure of base-build
622
+ - name : Display structure of base-build from origin/main
624
623
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') }}
650
624
- name : Ensure clean build directory
651
625
run : rm -rf build
652
626
- run : yarn install --frozen-lockfile
@@ -662,13 +636,6 @@ jobs:
662
636
node ./scripts/print-warnings/print-warnings.js > build/__test_utils__/ReactAllWarnings.js
663
637
- name : Display structure of build for PR
664
638
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
672
639
- run : echo ${{ github.sha }} >> build/COMMIT_SHA
673
640
- run : node ./scripts/tasks/danger
674
641
- name : Archive sizebot results
0 commit comments