mirror of
https://github.com/anomalyco/opencode.git
synced 2026-02-01 22:48:16 +00:00
sync
This commit is contained in:
27
.github/workflows/publish.yml
vendored
27
.github/workflows/publish.yml
vendored
@@ -46,6 +46,8 @@ jobs:
|
||||
OPENCODE_VERSION: ${{ inputs.version }}
|
||||
outputs:
|
||||
version: ${{ steps.version.outputs.version }}
|
||||
release: ${{ steps.version.outputs.release }}
|
||||
tag: ${{ steps.version.outputs.tag }}
|
||||
|
||||
build-cli:
|
||||
needs: version
|
||||
@@ -78,7 +80,6 @@ jobs:
|
||||
version: ${{ steps.publish.outputs.version }}
|
||||
|
||||
build-tauri:
|
||||
if: false
|
||||
needs:
|
||||
- build-cli
|
||||
- version
|
||||
@@ -175,6 +176,9 @@ jobs:
|
||||
tauriScript: ${{ (contains(matrix.settings.host, 'ubuntu') && 'cargo tauri') || '' }}
|
||||
args: --target ${{ matrix.settings.target }} --config ./src-tauri/tauri.prod.conf.json --verbose
|
||||
updaterJsonPreferNsis: true
|
||||
releaseId: ${{ needs.version.outputs.release }}
|
||||
tagName: ${{ needs.version.outputs.tag }}
|
||||
releaseDraft: true
|
||||
releaseAssetNamePattern: opencode-desktop-[platform]-[arch][ext]
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
@@ -191,6 +195,7 @@ jobs:
|
||||
publish:
|
||||
needs:
|
||||
- build-cli
|
||||
- build-tauri
|
||||
runs-on: blacksmith-4vcpu-ubuntu-2404
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
@@ -236,26 +241,6 @@ jobs:
|
||||
name: opencode-cli
|
||||
path: packages/opencode/dist
|
||||
|
||||
- name: Debug - verify artifact contents
|
||||
run: |
|
||||
echo "=== Contents of packages/opencode/dist ==="
|
||||
ls -la packages/opencode/dist/
|
||||
echo ""
|
||||
echo "=== All files recursively ==="
|
||||
find packages/opencode/dist -type f 2>/dev/null | head -30
|
||||
echo ""
|
||||
echo "=== Check opencode-linux-x64 structure ==="
|
||||
ls -la packages/opencode/dist/opencode-linux-x64/ 2>/dev/null || echo "Directory missing"
|
||||
echo ""
|
||||
echo "=== Check bin directory ==="
|
||||
ls -la packages/opencode/dist/opencode-linux-x64/bin/ 2>/dev/null || echo "Bin dir missing"
|
||||
echo ""
|
||||
echo "=== Check file types ==="
|
||||
find packages/opencode/dist -type f -name "opencode*" 2>/dev/null | head -5 | xargs file 2>/dev/null || echo "No files found"
|
||||
echo ""
|
||||
echo "=== Check permissions ==="
|
||||
find packages/opencode/dist -type f -name "opencode" 2>/dev/null | xargs ls -la 2>/dev/null || echo "No executables found"
|
||||
|
||||
- name: Make binaries executable
|
||||
run: |
|
||||
echo "Adding execute permissions to all binaries..."
|
||||
|
||||
@@ -6,13 +6,10 @@ import { $ } from "bun"
|
||||
const dir = new URL("..", import.meta.url).pathname
|
||||
process.chdir(dir)
|
||||
|
||||
await import("./build")
|
||||
|
||||
const pkg = await import("../package.json").then((m) => m.default)
|
||||
const original = JSON.parse(JSON.stringify(pkg))
|
||||
for (const [key, value] of Object.entries(pkg.exports)) {
|
||||
const file = value.replace("./src/", "./dist/").replace(".ts", "")
|
||||
/// @ts-expect-error
|
||||
pkg.exports[key] = {
|
||||
import: file + ".js",
|
||||
types: file + ".d.ts",
|
||||
|
||||
@@ -63,15 +63,17 @@ console.log("updated:", extensionToml)
|
||||
await Bun.file(extensionToml).write(toml)
|
||||
|
||||
await $`bun install`
|
||||
await import(`../packages/sdk/js/script/build.ts`)
|
||||
|
||||
if (!Script.preview) {
|
||||
if (!Script.preview || true) {
|
||||
await $`git commit -am "release: v${Script.version}"`
|
||||
await $`git tag v${Script.version}`
|
||||
await $`git fetch origin`
|
||||
await $`git cherry-pick HEAD..origin/dev`.nothrow()
|
||||
await $`git push origin HEAD --tags --no-verify --force-with-lease`
|
||||
await new Promise((resolve) => setTimeout(resolve, 5_000))
|
||||
await $`gh release create v${Script.version} -d --title "v${Script.version}" --notes ${notes.join("\n") || "No notable changes"} ./packages/opencode/dist/*.zip ./packages/opencode/dist/*.tar.gz`
|
||||
await $`gh release edit v${Script.version} --draft --title "v${Script.version}" --notes ${notes.join("\n") || "No notable changes"}`
|
||||
await $`gh release upload v${Script.version} ./packages/opencode/dist/*.zip ./packages/opencode/dist/*.tar.gz --clobber`
|
||||
}
|
||||
|
||||
console.log("\n=== cli ===\n")
|
||||
|
||||
@@ -1,9 +1,13 @@
|
||||
#!/usr/bin/env bun
|
||||
|
||||
import { Script } from "@opencode-ai/script"
|
||||
import { $ } from "bun"
|
||||
|
||||
let output = `version=${Script.version}\n`
|
||||
|
||||
await $`gh release create v${Script.version} -d --title "v${Script.version}"`
|
||||
const release = await $`gh release view v${Script.version} --json id,tagName`.json()
|
||||
output += `release=${release.id}\n`
|
||||
output += `tag=${release.tagName}\n`
|
||||
|
||||
if (process.env.GITHUB_OUTPUT) {
|
||||
await Bun.write(process.env.GITHUB_OUTPUT, output)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user