1
0
Fork 0
mirror of https://github.com/docker/build-push-action.git synced 2025-06-28 15:26:42 +02:00

initial code

This commit is contained in:
Prajjwal 2025-03-20 14:04:08 +05:30
parent 84ad562665
commit 6802d7df2c
8 changed files with 576 additions and 12 deletions

View file

@ -17,6 +17,8 @@ import {BuilderInfo} from '@docker/actions-toolkit/lib/types/buildx/builder';
import {ConfigFile} from '@docker/actions-toolkit/lib/types/docker/docker';
import {UploadArtifactResponse} from '@docker/actions-toolkit/lib/types/github';
import {WarpBuildRemoteBuilders} from './warpbuild';
import * as context from './context';
actionsToolkit.run(
@ -28,6 +30,17 @@ actionsToolkit.run(
stateHelper.setInputs(inputs);
const toolkit = new Toolkit();
const parsedTimeout = parseInt(inputs.timeout);
const remoteBuilders = new WarpBuildRemoteBuilders({
apiKey: inputs.apiKey,
profileName: inputs.profileName,
timeout: parsedTimeout
});
// We don't need to wait for the builder assignment to complete here
// because the setupBuilders() method will wait for it if needed
remoteBuilders.assignBuilder();
await core.group(`GitHub Actions runtime token ACs`, async () => {
try {
@ -82,6 +95,8 @@ actionsToolkit.run(
await toolkit.buildx.printVersion();
});
await remoteBuilders.setupBuilders();
let builder: BuilderInfo;
await core.group(`Builder info`, async () => {
builder = await toolkit.builder.inspect(inputs.builder);
@ -258,13 +273,16 @@ function buildChecksAnnotationsEnabled(): boolean {
}
function buildSummaryEnabled(): boolean {
if (process.env.DOCKER_BUILD_NO_SUMMARY) {
core.warning('DOCKER_BUILD_NO_SUMMARY is deprecated. Set DOCKER_BUILD_SUMMARY to false instead.');
return !Util.parseBool(process.env.DOCKER_BUILD_NO_SUMMARY);
} else if (process.env.DOCKER_BUILD_SUMMARY) {
return Util.parseBool(process.env.DOCKER_BUILD_SUMMARY);
}
return true;
// WarpBuild remote builders don't support build summary
return false;
// if (process.env.DOCKER_BUILD_NO_SUMMARY) {
// core.warning('DOCKER_BUILD_NO_SUMMARY is deprecated. Set DOCKER_BUILD_SUMMARY to false instead.');
// return !Util.parseBool(process.env.DOCKER_BUILD_NO_SUMMARY);
// } else if (process.env.DOCKER_BUILD_SUMMARY) {
// return Util.parseBool(process.env.DOCKER_BUILD_SUMMARY);
// }
// return true;
}
function buildRecordUploadEnabled(): boolean {