From 5dd74f8523842740bd081e55a39d6b1652b4171b Mon Sep 17 00:00:00 2001 From: Aidan Timson Date: Mon, 15 Dec 2025 09:56:02 +0000 Subject: [PATCH] Split modern and legacy builds --- .github/workflows/ci.yaml | 8 ++++++-- build-scripts/gulp/rspack.js | 25 ++++++++++++++++++++----- 2 files changed, 26 insertions(+), 7 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index e4afbaef97..02021293a6 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -71,9 +71,12 @@ jobs: - name: Run Tests run: yarn run test build: - name: Build frontend + name: Build frontend (${{ matrix.target }}) needs: [lint, test] runs-on: ubuntu-latest + strategy: + matrix: + target: [modern, legacy] steps: - name: Check out files from GitHub uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1 @@ -88,10 +91,11 @@ jobs: run: ./node_modules/.bin/gulp build-app env: IS_TEST: "true" + BUILD_TARGET: ${{ matrix.target }} - name: Upload bundle stats uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5.0.0 with: - name: frontend-bundle-stats + name: frontend-bundle-stats-${{ matrix.target }} path: build/stats/*.json if-no-files-found: error supervisor: diff --git a/build-scripts/gulp/rspack.js b/build-scripts/gulp/rspack.js index 84f9d71079..c0caee5025 100644 --- a/build-scripts/gulp/rspack.js +++ b/build-scripts/gulp/rspack.js @@ -17,6 +17,18 @@ import { createLandingPageConfig, } from "../rspack.cjs"; +const selectBuildTargets = () => { + const target = process.env.BUILD_TARGET?.toLowerCase(); + switch (target) { + case "modern": + return [true]; + case "legacy": + return [false]; + default: + return [true, false]; + } +}; + const bothBuilds = (createConfigFunc, params) => [ createConfigFunc({ ...params, latestBuild: true }), createConfigFunc({ ...params, latestBuild: false }), @@ -112,11 +124,14 @@ gulp.task("rspack-watch-app", () => { gulp.task("rspack-prod-app", () => prodBuild( - bothBuilds(createAppConfig, { - isProdBuild: true, - isStatsBuild: env.isStatsBuild(), - isTestBuild: env.isTestBuild(), - }) + selectBuildTargets().map((latestBuild) => + createAppConfig({ + isProdBuild: true, + isStatsBuild: env.isStatsBuild(), + isTestBuild: env.isTestBuild(), + latestBuild, + }) + ) ) );