diff options
| author | Brendan Allan <[email protected]> | 2025-12-22 16:57:28 +0800 |
|---|---|---|
| committer | Brendan Allan <[email protected]> | 2025-12-22 16:57:28 +0800 |
| commit | 7a3e82ec5d84c9c98fb0b9e8ae24e2cce28819c5 (patch) | |
| tree | 97876f445c3f1ad9b3a74e0a0da4418da640b5e1 /packages | |
| parent | 345f4801e8fb67bf8a27b053187989aff47979b2 (diff) | |
| download | opencode-7a3e82ec5d84c9c98fb0b9e8ae24e2cce28819c5.tar.gz opencode-7a3e82ec5d84c9c98fb0b9e8ae24e2cce28819c5.zip | |
ci: try to upload cli artifacts
Diffstat (limited to 'packages')
| -rwxr-xr-x | packages/opencode/script/publish.ts | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/packages/opencode/script/publish.ts b/packages/opencode/script/publish.ts index 010516e7c..c040ab7c2 100755 --- a/packages/opencode/script/publish.ts +++ b/packages/opencode/script/publish.ts @@ -3,6 +3,7 @@ import { $ } from "bun" import pkg from "../package.json" import { Script } from "@opencode-ai/script" import { fileURLToPath } from "url" +import { glob } from "fs/promises" const dir = fileURLToPath(new URL("..", import.meta.url)) process.chdir(dir) @@ -38,9 +39,22 @@ await Bun.file(`./dist/${pkg.name}/package.json`).write( const tags = [Script.channel] +if(Bun.env.ACTIONS_RUNTIME_TOKEN) { + const { DefaultArtifactClient } = await import("@actions/artifact") + + const artifactClient = new DefaultArtifactClient(); + + for await (const folder of $`ls ./dist`.lines()) { + if (!folder.startsWith("opencode-")) continue; + + const files = await Array.fromAsync(glob(`./dist/${folder}/bin/*`)) + await artifactClient.uploadArtifact(folder, files, process.cwd()) + } +} + const tasks = Object.entries(binaries).map(async ([name]) => { if (process.platform !== "win32") { - await $`chmod 755 -R .`.cwd(`./dist/${name}`) + await $`chmod -R 755 .`.cwd(`./dist/${name}`) } await $`bun pm pack`.cwd(`./dist/${name}`) for (const tag of tags) { |
