Skip to content

Commit d183568

Browse files
committed
core: ensure executable permissions are set before Docker builds
Fixes an issue where GitHub artifact downloads could strip executable bits from binaries, causing Docker builds to fail when using unpacked dist files directly rather than published tarballs. The chmod now runs before the publish check to guarantee binaries are executable.
1 parent f27eb8f commit d183568

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

packages/opencode/script/publish.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,13 @@ async function published(name: string, version: string) {
1212
}
1313

1414
async function publish(dir: string, name: string, version: string) {
15+
// GitHub artifact downloads can drop the executable bit, and Docker uses the
16+
// unpacked dist binaries directly rather than the published tarball.
17+
if (process.platform !== "win32") await $`chmod -R 755 .`.cwd(dir)
1518
if (await published(name, version)) {
1619
console.log(`already published ${name}@${version}`)
1720
return
1821
}
19-
if (process.platform !== "win32") await $`chmod -R 755 .`.cwd(dir)
2022
await $`bun pm pack`.cwd(dir)
2123
await $`npm publish *.tgz --access public --tag ${Script.channel}`.cwd(dir)
2224
}

0 commit comments

Comments
 (0)