From cfe43efa8c3161902afd4df9445f5cc125122d9d Mon Sep 17 00:00:00 2001 From: Daz DeBoer Date: Wed, 10 Nov 2021 20:16:17 -0700 Subject: [PATCH] Rename cache-metadata file and bump protocol version --- src/cache-base.ts | 2 +- src/cache-gradle-user-home.ts | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/cache-base.ts b/src/cache-base.ts index a0276c5..014b95c 100644 --- a/src/cache-base.ts +++ b/src/cache-base.ts @@ -3,7 +3,7 @@ import * as cache from '@actions/cache' import * as github from '@actions/github' import {isCacheDebuggingEnabled, getCacheKeyPrefix, hashStrings, handleCacheFailure} from './cache-utils' -const CACHE_PROTOCOL_VERSION = 'v4-' +const CACHE_PROTOCOL_VERSION = 'v5-' const JOB_CONTEXT_PARAMETER = 'workflow-job-context' function generateCacheKey(cacheName: string): CacheKey { diff --git a/src/cache-gradle-user-home.ts b/src/cache-gradle-user-home.ts index 953c32b..42a0918 100644 --- a/src/cache-gradle-user-home.ts +++ b/src/cache-gradle-user-home.ts @@ -9,6 +9,7 @@ import {AbstractCache, CacheEntryListener, CacheListener} from './cache-base' import {getCacheKeyPrefix, hashFileNames, tryDelete} from './cache-utils' const META_FILE_DIR = '.gradle-build-action' +const META_FILE = 'cache-metadata.json' const INCLUDE_PATHS_PARAMETER = 'gradle-home-cache-includes' const EXCLUDE_PATHS_PARAMETER = 'gradle-home-cache-excludes' @@ -178,7 +179,7 @@ export class GradleUserHomeCache extends AbstractCache { } private loadBundleMetadata(): Map { - const bundleMetaFile = path.resolve(this.gradleUserHome, META_FILE_DIR, 'bundles.json') + const bundleMetaFile = path.resolve(this.gradleUserHome, META_FILE_DIR, META_FILE) if (!fs.existsSync(bundleMetaFile)) { return new Map() } @@ -198,7 +199,7 @@ export class GradleUserHomeCache extends AbstractCache { core.debug(`Saving bundle metadata: ${filedata}`) const bundleMetaDir = path.resolve(this.gradleUserHome, META_FILE_DIR) - const bundleMetaFile = path.resolve(bundleMetaDir, 'bundles.json') + const bundleMetaFile = path.resolve(bundleMetaDir, META_FILE) if (!fs.existsSync(bundleMetaDir)) { fs.mkdirSync(bundleMetaDir, {recursive: true})