Skip to content

Commit cb1a1fb

Browse files
committed
try uploading artifacts in workflow
1 parent af5ebab commit cb1a1fb

File tree

2 files changed

+18
-1
lines changed

2 files changed

+18
-1
lines changed

.github/workflows/publish.yml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,24 @@ jobs:
9393
GITHUB_TOKEN: ${{ secrets.SST_GITHUB_TOKEN }}
9494
NPM_CONFIG_PROVENANCE: false
9595

96+
- name: "Upload folders as artifacts"
97+
id: upload-artifacts
98+
shell: bun {0}
99+
working-directory: packages/opencode
100+
run: |
101+
import * as fs from 'fs/promises';
102+
import * as path from 'path';
103+
import { DefaultArtifactClient } from "@actions/artifact";
104+
105+
const artifactClient = new DefaultArtifactClient()
106+
107+
for await (const folder of $`ls ./dist`.lines()) {
108+
if (!folder.startsWith("opencode-")) continue
109+
110+
const files = await Array.fromAsync(await fs.glob(`./dist/${folder}/bin/*`))
111+
await artifactClient.uploadArtifact(folder, files, process.cwd())
112+
}
113+
96114
outputs:
97115
release: ${{ steps.publish.outputs.release }}
98116
tag: ${{ steps.publish.outputs.tag }}

packages/opencode/script/publish.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ import { $ } from "bun"
33
import pkg from "../package.json"
44
import { Script } from "@opencode-ai/script"
55
import { fileURLToPath } from "url"
6-
import { glob } from "fs/promises"
76

87
const dir = fileURLToPath(new URL("..", import.meta.url))
98
process.chdir(dir)

0 commit comments

Comments
 (0)