Dax Raad před 2 měsíci
rodič
revize
fe6abe8ade
2 změnil soubory, kde provedl 9 přidání a 10 odebrání
  1. 1 0
      .github/workflows/publish.yml
  2. 8 10
      packages/opencode/script/build.ts

+ 1 - 0
.github/workflows/publish.yml

@@ -70,6 +70,7 @@ jobs:
         env:
           OPENCODE_VERSION: ${{ needs.version.outputs.version }}
           OPENCODE_RELEASE: ${{ needs.version.outputs.release }}
+          GH_TOKEN: ${{ github.token }}
 
       - uses: actions/upload-artifact@v4
         with:

+ 8 - 10
packages/opencode/script/build.ts

@@ -179,17 +179,15 @@ for (const item of targets) {
   binaries[name] = Script.version
 }
 
-for (const key of Object.keys(binaries)) {
-  if (key.includes("linux")) {
-    await $`tar -czf ../../${key}.tar.gz *`.cwd(`dist/${key}/bin`)
-  } else {
-    await $`zip -r ../../${key}.zip *`.cwd(`dist/${key}/bin`)
+if (Script.release) {
+  for (const key of Object.keys(binaries)) {
+    if (key.includes("linux")) {
+      await $`tar -czf ../../${key}.tar.gz *`.cwd(`dist/${key}/bin`)
+    } else {
+      await $`zip -r ../../${key}.zip *`.cwd(`dist/${key}/bin`)
+    }
   }
+  await $`gh release upload v${Script.release} ./dist/*.zip ./dist/*.tar.gz --clobber`
 }
-if (!Script.release) {
-  throw new Error("Missing OPENCODE_RELEASE environment variable")
-}
-
-await $`gh release upload v${Script.release} ./dist/*.zip ./dist/*.tar.gz --clobber`
 
 export { binaries }