mirror of
https://github.com/gradle/actions.git
synced 2026-04-19 18:12:58 +08:00
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:
@@ -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
|
||||
}
|
||||
|
||||
@@ -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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user