فهرست منبع

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.
Dax Raad 4 ماه پیش
والد
کامیت
d183568644
1فایلهای تغییر یافته به همراه3 افزوده شده و 1 حذف شده
  1. 3 1
      packages/opencode/script/publish.ts

+ 3 - 1
packages/opencode/script/publish.ts

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