cache-binary input to enable/disable caching binary to GHA cache backend

Signed-off-by: CrazyMax <1951866+crazy-max@users.noreply.github.com>
This commit is contained in:
CrazyMax 2024-02-23 10:51:47 +01:00
parent 524315340d
commit a4180f835d
No known key found for this signature in database
GPG key ID: ADE44D8C9D44FBE4
6 changed files with 37 additions and 2 deletions

View file

@ -20,6 +20,7 @@ export interface Inputs {
config: string;
configInline: string;
append: string;
cacheBinary: boolean;
cleanup: boolean;
}
@ -37,6 +38,7 @@ export async function getInputs(): Promise<Inputs> {
config: core.getInput('config'),
configInline: core.getInput('config-inline'),
append: core.getInput('append'),
cacheBinary: core.getBooleanInput('cache-binary'),
cleanup: core.getBooleanInput('cleanup')
};
}

View file

@ -38,11 +38,11 @@ actionsToolkit.run(
throw new Error(`Cannot build from source without the Docker CLI`);
}
await core.group(`Build buildx from source`, async () => {
toolPath = await toolkit.buildxInstall.build(inputs.version);
toolPath = await toolkit.buildxInstall.build(inputs.version, !inputs.cacheBinary);
});
} else if (!(await toolkit.buildx.isAvailable()) || inputs.version) {
await core.group(`Download buildx from GitHub Releases`, async () => {
toolPath = await toolkit.buildxInstall.download(inputs.version || 'latest');
toolPath = await toolkit.buildxInstall.download(inputs.version || 'latest', !inputs.cacheBinary);
});
}
if (toolPath) {