Merge pull request #828 from crazy-max/cosign-skip-state
cosign(install): skipState opt to directly upload to GHA cache
This commit is contained in:
@@ -48,7 +48,7 @@ export class Install {
|
|||||||
this.buildx = opts?.buildx || new Buildx();
|
this.buildx = opts?.buildx || new Buildx();
|
||||||
}
|
}
|
||||||
|
|
||||||
public async download(v: string, ghaNoCache?: boolean): Promise<string> {
|
public async download(v: string, ghaNoCache?: boolean, skipState?: boolean): Promise<string> {
|
||||||
const version: DownloadVersion = await Install.getDownloadVersion(v);
|
const version: DownloadVersion = await Install.getDownloadVersion(v);
|
||||||
core.debug(`Install.download version: ${version.version}`);
|
core.debug(`Install.download version: ${version.version}`);
|
||||||
|
|
||||||
@@ -83,12 +83,12 @@ export class Install {
|
|||||||
const htcDownloadPath = await tc.downloadTool(downloadURL, undefined, this.githubToken);
|
const htcDownloadPath = await tc.downloadTool(downloadURL, undefined, this.githubToken);
|
||||||
core.debug(`Install.download htcDownloadPath: ${htcDownloadPath}`);
|
core.debug(`Install.download htcDownloadPath: ${htcDownloadPath}`);
|
||||||
|
|
||||||
const cacheSavePath = await installCache.save(htcDownloadPath);
|
const cacheSavePath = await installCache.save(htcDownloadPath, skipState);
|
||||||
core.info(`Cached to ${cacheSavePath}`);
|
core.info(`Cached to ${cacheSavePath}`);
|
||||||
return cacheSavePath;
|
return cacheSavePath;
|
||||||
}
|
}
|
||||||
|
|
||||||
public async build(gitContext: string, ghaNoCache?: boolean): Promise<string> {
|
public async build(gitContext: string, ghaNoCache?: boolean, skipState?: boolean): Promise<string> {
|
||||||
const vspec = await this.vspec(gitContext);
|
const vspec = await this.vspec(gitContext);
|
||||||
core.debug(`Install.build vspec: ${vspec}`);
|
core.debug(`Install.build vspec: ${vspec}`);
|
||||||
|
|
||||||
@@ -119,7 +119,7 @@ export class Install {
|
|||||||
return `${outputDir}/cosign`;
|
return `${outputDir}/cosign`;
|
||||||
});
|
});
|
||||||
|
|
||||||
const cacheSavePath = await installCache.save(buildBinPath);
|
const cacheSavePath = await installCache.save(buildBinPath, skipState);
|
||||||
core.info(`Cached to ${cacheSavePath}`);
|
core.info(`Cached to ${cacheSavePath}`);
|
||||||
return cacheSavePath;
|
return cacheSavePath;
|
||||||
}
|
}
|
||||||
@@ -139,7 +139,7 @@ export class Install {
|
|||||||
fs.chmodSync(cosignPath, '0755');
|
fs.chmodSync(cosignPath, '0755');
|
||||||
|
|
||||||
core.addPath(binDir);
|
core.addPath(binDir);
|
||||||
core.info('Added Unodck to PATH');
|
core.info('Added Cosign to PATH');
|
||||||
|
|
||||||
core.info(`Binary path: ${cosignPath}`);
|
core.info(`Binary path: ${cosignPath}`);
|
||||||
return cosignPath;
|
return cosignPath;
|
||||||
|
|||||||
@@ -71,7 +71,7 @@ export class Install {
|
|||||||
|
|
||||||
const cacheFoundPath = await installCache.find();
|
const cacheFoundPath = await installCache.find();
|
||||||
if (cacheFoundPath) {
|
if (cacheFoundPath) {
|
||||||
core.info(`Unodck binary found in ${cacheFoundPath}`);
|
core.info(`Undock binary found in ${cacheFoundPath}`);
|
||||||
return cacheFoundPath;
|
return cacheFoundPath;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -112,7 +112,7 @@ export class Install {
|
|||||||
fs.chmodSync(undockPath, '0755');
|
fs.chmodSync(undockPath, '0755');
|
||||||
|
|
||||||
core.addPath(binDir);
|
core.addPath(binDir);
|
||||||
core.info('Added Unodck to PATH');
|
core.info('Added Undock to PATH');
|
||||||
|
|
||||||
core.info(`Binary path: ${undockPath}`);
|
core.info(`Binary path: ${undockPath}`);
|
||||||
return undockPath;
|
return undockPath;
|
||||||
|
|||||||
Reference in New Issue
Block a user