Fix legacy caching module distribution for CI

The legacy caching bundle at sources/legacy-caching/dist/ was
gitignored by sources/.gitignore, so CI never included it. Fix by:
- Copying the bundle into sources/dist/legacy-caching/ during build
- Updating the loader path to resolve from dist/legacy-caching/
- Adding legacy module build steps to build-dist action and
  ci-update-dist workflow

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
Daz DeBoer
2026-04-01 13:28:18 -06:00
parent e48bd1161b
commit 0ea104b0b8
5 changed files with 21 additions and 11 deletions
@@ -90,16 +90,6 @@ export function findGradleExecutableForCleanup(buildResults: BuildResults): stri
}
}
// Try the Gradle installation directory as a fallback
for (const result of buildResults.results) {
if (versionIsAtLeast(result.gradleVersion, '8.11')) {
const executable = path.resolve(result.gradleHomeDir, 'bin', IS_WINDOWS ? 'gradle.bat' : 'gradle')
if (fs.existsSync(executable)) {
return executable
}
}
}
core.info('Could not locate a Gradle >= 8.11 executable for cache cleanup.')
return null
}
+1 -1
View File
@@ -75,7 +75,7 @@ export async function loadVendoredCacheService(): Promise<CacheService> {
}
export async function loadLegacyCacheService(): Promise<CacheService> {
const legacyLibraryPath = findLibraryPath('sources/legacy-caching/dist/index.js')
const legacyLibraryPath = findLibraryPath('dist/legacy-caching/index.js')
const moduleUrl = pathToFileURL(legacyLibraryPath).href
return (await import(moduleUrl)) as CacheService
}