mirror of
https://github.com/docker/setup-buildx-action.git
synced 2025-06-24 03:47:58 +02:00
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:
@ -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')
|
||||
};
|
||||
}
|
||||
|
@ -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) {
|
||||
|
Reference in New Issue
Block a user