From ec56970646c924179d9ef119d80fcb8bc26f8eac Mon Sep 17 00:00:00 2001 From: sudacode Date: Wed, 18 Mar 2026 02:37:58 -0700 Subject: [PATCH] fix(ci): install stats deps in release builds --- .github/workflows/release.yml | 21 +++++++++++++++------ src/release-workflow.test.ts | 9 +++++++++ 2 files changed, 24 insertions(+), 6 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 8913a47..885975c 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -89,14 +89,17 @@ jobs: path: | ~/.bun/install/cache node_modules + stats/node_modules vendor/texthooker-ui/node_modules vendor/subminer-yomitan/node_modules - key: ${{ runner.os }}-bun-${{ hashFiles('bun.lock', 'vendor/texthooker-ui/package.json', 'vendor/subminer-yomitan/package-lock.json') }} + key: ${{ runner.os }}-bun-${{ hashFiles('bun.lock', 'stats/bun.lock', 'vendor/texthooker-ui/package.json', 'vendor/subminer-yomitan/package-lock.json') }} restore-keys: | ${{ runner.os }}-bun- - name: Install dependencies - run: bun install --frozen-lockfile + run: | + bun install --frozen-lockfile + cd stats && bun install --frozen-lockfile - name: Build texthooker-ui run: | @@ -144,9 +147,10 @@ jobs: path: | ~/.bun/install/cache node_modules + stats/node_modules vendor/texthooker-ui/node_modules vendor/subminer-yomitan/node_modules - key: ${{ runner.os }}-bun-${{ hashFiles('bun.lock', 'vendor/texthooker-ui/package.json', 'vendor/subminer-yomitan/package-lock.json') }} + key: ${{ runner.os }}-bun-${{ hashFiles('bun.lock', 'stats/bun.lock', 'vendor/texthooker-ui/package.json', 'vendor/subminer-yomitan/package-lock.json') }} restore-keys: | ${{ runner.os }}-bun- @@ -171,7 +175,9 @@ jobs: APPLE_TEAM_ID: ${{ secrets.APPLE_TEAM_ID }} - name: Install dependencies - run: bun install --frozen-lockfile + run: | + bun install --frozen-lockfile + cd stats && bun install --frozen-lockfile - name: Build texthooker-ui run: | @@ -216,14 +222,17 @@ jobs: path: | ~/.bun/install/cache node_modules + stats/node_modules vendor/texthooker-ui/node_modules vendor/subminer-yomitan/node_modules - key: ${{ runner.os }}-bun-${{ hashFiles('bun.lock', 'vendor/texthooker-ui/package.json', 'vendor/subminer-yomitan/package-lock.json') }} + key: ${{ runner.os }}-bun-${{ hashFiles('bun.lock', 'stats/bun.lock', 'vendor/texthooker-ui/package.json', 'vendor/subminer-yomitan/package-lock.json') }} restore-keys: | ${{ runner.os }}-bun- - name: Install dependencies - run: bun install --frozen-lockfile + run: | + bun install --frozen-lockfile + cd stats && bun install --frozen-lockfile - name: Build texthooker-ui shell: powershell diff --git a/src/release-workflow.test.ts b/src/release-workflow.test.ts index 685773c..f2eb4a5 100644 --- a/src/release-workflow.test.ts +++ b/src/release-workflow.test.ts @@ -28,6 +28,15 @@ test('release workflow verifies generated config examples before packaging artif assert.match(releaseWorkflow, /bun run verify:config-example/); }); +test('release build jobs install and cache stats dependencies before packaging', () => { + assert.match(releaseWorkflow, /build-linux:[\s\S]*stats\/node_modules/); + assert.match(releaseWorkflow, /build-macos:[\s\S]*stats\/node_modules/); + assert.match(releaseWorkflow, /build-windows:[\s\S]*stats\/node_modules/); + assert.match(releaseWorkflow, /build-linux:[\s\S]*cd stats && bun install --frozen-lockfile/); + assert.match(releaseWorkflow, /build-macos:[\s\S]*cd stats && bun install --frozen-lockfile/); + assert.match(releaseWorkflow, /build-windows:[\s\S]*cd stats && bun install --frozen-lockfile/); +}); + test('release workflow generates release notes from committed changelog output', () => { assert.match(releaseWorkflow, /bun run changelog:release-notes/); assert.ok(!releaseWorkflow.includes('git log --pretty=format:"- %s"'));