mirror of
https://github.com/goreleaser/goreleaser-action.git
synced 2026-05-15 23:20:32 +00:00
feat: use cached binary if present
This commit is contained in:
parent
9cf36111e7
commit
d9b8ef613e
4 changed files with 18 additions and 5 deletions
6
dist/index.js
generated
vendored
6
dist/index.js
generated
vendored
File diff suppressed because one or more lines are too long
2
dist/index.js.map
generated
vendored
2
dist/index.js.map
generated
vendored
File diff suppressed because one or more lines are too long
2
dist/sourcemap-register.js
generated
vendored
2
dist/sourcemap-register.js
generated
vendored
File diff suppressed because one or more lines are too long
|
|
@ -17,6 +17,19 @@ export async function install(distribution: string, version: string): Promise<st
|
|||
filename
|
||||
);
|
||||
|
||||
const toolPath: string = tc.find('goreleaser-action', release.tag_name.replace(/^v/, ''), context.osArch);
|
||||
if (toolPath) {
|
||||
core.info(`Found in cache @ ${toolPath}`);
|
||||
const exePath: string = path.join(toolPath, context.osPlat == 'win32' ? 'goreleaser.exe' : 'goreleaser');
|
||||
try {
|
||||
// return path only after confirming it exists and is executable
|
||||
await fs.promises.access(exePath, fs.constants.F_OK | fs.constants.X_OK)
|
||||
return exePath;
|
||||
} catch (err) {
|
||||
core.warning(`Cached tool directory found but executable is not accessible or not executable: ${err.message}`);
|
||||
}
|
||||
}
|
||||
|
||||
core.info(`Downloading ${downloadUrl}`);
|
||||
const downloadPath: string = await tc.downloadTool(downloadUrl);
|
||||
core.debug(`Downloaded to ${downloadPath}`);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue