fix version release for Dockerfile build (#1080)

This commit is contained in:
Zach Sais
2025-06-16 01:13:39 -05:00
committed by GitHub
parent 40fbb61a1b
commit cc7459e403
4 changed files with 19 additions and 4 deletions

View File

@@ -109,8 +109,14 @@ function buildImage(imageName, dockerfile) {
? `${sandboxCommand} build --authfile=<(echo '{}')`
: `${sandboxCommand} --config=".docker" buildx build`;
const npmPackageVersion = JSON.parse(
readFileSync(join(process.cwd(), 'package.json'), 'utf-8'),
).version;
execSync(
`${buildCommand} ${process.env.BUILD_SANDBOX_FLAGS || ''} -f "${dockerfile}" -t "${imageName}" .`,
`${buildCommand} ${
process.env.BUILD_SANDBOX_FLAGS || ''
} --build-arg CLI_VERSION_ARG=${npmPackageVersion} -f "${dockerfile}" -t "${imageName}" .`,
{ stdio: buildStdout, shell: '/bin/bash' },
);
console.log(`built ${imageName}`);