Skip to content

Commit

Permalink
fix(release): concatenate the path
Browse files Browse the repository at this point in the history
  • Loading branch information
Malinskiy committed Feb 7, 2024
1 parent f87bc63 commit b95bb1c
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 12 deletions.
9 changes: 5 additions & 4 deletions lib/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -6785,12 +6785,13 @@ function downloadAndCache(artifact) {
core.debug(`Downloaded ${artifact.checksumUrl} to ${artifactChecksum}`);
yield verifyChecksum(artifactZipball, artifact.artifactName, artifactChecksum);
core.debug(`Verified checksum of ${artifactZipball}`);
const artifactFolder = os_1.platform.name.startsWith('win')
const extractedPath = os_1.platform.name.startsWith('win')
? yield tc.extractZip(artifactZipball)
: yield tc.extractTar(artifactZipball);
core.debug(`Extracted ${artifactZipball} to ${artifactFolder}`);
const actualFolder = fs.readdirSync(artifactFolder)[0];
const cachedDir = yield tc.cacheDir(actualFolder, TOOL_NAME, artifact.version);
core.debug(`Extracted ${artifactZipball} to ${extractedPath}`);
const archiveName = fs.readdirSync(extractedPath)[0];
const archivePath = path_1.default.join(extractedPath, archiveName);
const cachedDir = yield tc.cacheDir(archivePath, TOOL_NAME, artifact.version);
const rv = resolveBinaryPath(artifact, cachedDir);
core.debug(`Cached ${TOOL_NAME} to ${rv}`);
return rv;
Expand Down
13 changes: 5 additions & 8 deletions src/release.ts
Original file line number Diff line number Diff line change
Expand Up @@ -128,17 +128,14 @@ async function downloadAndCache(artifact: BinaryArtifact): Promise<string> {
);
core.debug(`Verified checksum of ${artifactZipball}`);

const artifactFolder = platform.name.startsWith('win')
const extractedPath = platform.name.startsWith('win')
? await tc.extractZip(artifactZipball)
: await tc.extractTar(artifactZipball);
core.debug(`Extracted ${artifactZipball} to ${artifactFolder}`);
const actualFolder = fs.readdirSync(artifactFolder)[0];
core.debug(`Extracted ${artifactZipball} to ${extractedPath}`);
const archiveName = fs.readdirSync(extractedPath)[0];
const archivePath = path.join(extractedPath, archiveName);

const cachedDir = await tc.cacheDir(
actualFolder,
TOOL_NAME,
artifact.version,
);
const cachedDir = await tc.cacheDir(archivePath, TOOL_NAME, artifact.version);
const rv = resolveBinaryPath(artifact, cachedDir);
core.debug(`Cached ${TOOL_NAME} to ${rv}`);

Expand Down

0 comments on commit b95bb1c

Please sign in to comment.