mirror of
https://github.com/sst/opencode.git
synced 2025-12-23 10:11:41 +00:00
try uploading artifacts in workflow
This commit is contained in:
parent
af5ebabd03
commit
cb1a1fb26c
2 changed files with 18 additions and 1 deletions
18
.github/workflows/publish.yml
vendored
18
.github/workflows/publish.yml
vendored
|
|
@ -93,6 +93,24 @@ jobs:
|
|||
GITHUB_TOKEN: ${{ secrets.SST_GITHUB_TOKEN }}
|
||||
NPM_CONFIG_PROVENANCE: false
|
||||
|
||||
- name: "Upload folders as artifacts"
|
||||
id: upload-artifacts
|
||||
shell: bun {0}
|
||||
working-directory: packages/opencode
|
||||
run: |
|
||||
import * as fs from 'fs/promises';
|
||||
import * as path from 'path';
|
||||
import { DefaultArtifactClient } from "@actions/artifact";
|
||||
|
||||
const artifactClient = new DefaultArtifactClient()
|
||||
|
||||
for await (const folder of $`ls ./dist`.lines()) {
|
||||
if (!folder.startsWith("opencode-")) continue
|
||||
|
||||
const files = await Array.fromAsync(await fs.glob(`./dist/${folder}/bin/*`))
|
||||
await artifactClient.uploadArtifact(folder, files, process.cwd())
|
||||
}
|
||||
|
||||
outputs:
|
||||
release: ${{ steps.publish.outputs.release }}
|
||||
tag: ${{ steps.publish.outputs.tag }}
|
||||
|
|
|
|||
|
|
@ -3,7 +3,6 @@ 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)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue