mirror of
https://github.com/docker/setup-buildx-action.git
synced 2025-04-21 10:06:46 +00: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:
parent
524315340d
commit
a4180f835d
6 changed files with 37 additions and 2 deletions
|
@ -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) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue