From fe1b5f9a55dcdc10ce7c0dafe105ee776b933c08 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Catriel=20M=C3=BCller?= Date: Tue, 3 Feb 2026 09:31:47 -0300 Subject: [PATCH] fix: fix release archives --- .github/workflows/publish-next.yml | 72 ------------------- packages/opencode/script/pack.ts | 9 ++- .../opencode/script/publish-registries.ts | 14 ++-- packages/opencode/script/publish.ts | 10 ++- script/publish-start.ts | 2 +- 5 files changed, 25 insertions(+), 82 deletions(-) delete mode 100644 .github/workflows/publish-next.yml diff --git a/.github/workflows/publish-next.yml b/.github/workflows/publish-next.yml deleted file mode 100644 index e55cbb8d1f..0000000000 --- a/.github/workflows/publish-next.yml +++ /dev/null @@ -1,72 +0,0 @@ -# kilocode_change - new file -# -# Next Release Workflow for Kilo CLI -# =================================== -# -# HOW TO RELEASE: -# 1. Go to GitHub Actions → publish-next -# 2. Click "Run workflow" -# 3. Optionally enter a version (e.g., 1.2.0-next.1) -# 4. Click "Run workflow" -# -# HOW USERS INSTALL: -# npm install -g @kilocode/cli@next -# -# REQUIRED GITHUB SECRETS: -# - NPM_TOKEN: npm authentication token with publish access to @kilocode/cli -# (Get from: npmjs.com → Access Tokens → Generate New Token → Automation) -# -# WHAT THIS DOES: -# - Runs the existing publish-start.ts script with OPENCODE_CHANNEL=next -# - Builds all platform binaries (Linux, macOS, Windows, x64, ARM64) -# - Publishes to npm with @next tag (won't affect stable users) -# - Version format: 0.0.0-next-{timestamp} (auto) or custom (manual input) -# - Does NOT create git tags or GitHub releases (preview mode) -# -name: publish-next -run-name: "next release ${{ inputs.version || 'auto' }}" - -on: - workflow_dispatch: - inputs: - version: - description: "Override version (optional, e.g., 1.2.0-next.1)" - required: false - type: string - -concurrency: ${{ github.workflow }}-${{ github.ref }}-${{ inputs.version }} - -permissions: - id-token: write - contents: write - packages: write - -jobs: - publish-next: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - - run: git fetch --force --tags - - - uses: ./.github/actions/setup-bun - - - uses: actions/setup-node@v4 - with: - node-version: "24" - registry-url: "https://registry.npmjs.org" - - - name: Publish Next - run: ./script/publish-start.ts - env: - OPENCODE_CHANNEL: next - OPENCODE_VERSION: ${{ inputs.version }} - NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - - uses: actions/upload-artifact@v4 - with: - name: kilocode-cli-next - path: packages/opencode/dist diff --git a/packages/opencode/script/pack.ts b/packages/opencode/script/pack.ts index 6534112c28..497e7f3ad1 100755 --- a/packages/opencode/script/pack.ts +++ b/packages/opencode/script/pack.ts @@ -52,13 +52,18 @@ for (const tag of tags) { if (!Script.preview) { // Create archives for GitHub release + // kilocode_change start - use absolute paths to avoid issues with scoped package names containing '/' + const archiveDir = `${dir}/dist/archives` + await $`mkdir -p ${archiveDir}` for (const key of Object.keys(binaries)) { + const archiveName = key.replace("/", "-") // @kilocode/cli-linux-arm64 → @kilocode-cli-linux-arm64 if (key.includes("linux")) { - await $`tar -czf ../../${key}.tar.gz *`.cwd(`dist/${key}/bin`) + await $`tar -czf ${archiveDir}/${archiveName}.tar.gz *`.cwd(`dist/${key}/bin`) } else { - await $`zip -r ../../${key}.zip *`.cwd(`dist/${key}/bin`) + await $`zip -r ${archiveDir}/${archiveName}.zip *`.cwd(`dist/${key}/bin`) } } + // kilocode_change end const image = "ghcr.io/Kilo-Org/kilo" const platforms = "linux/amd64,linux/arm64" diff --git a/packages/opencode/script/publish-registries.ts b/packages/opencode/script/publish-registries.ts index b6d1b686a8..41d990b5df 100644 --- a/packages/opencode/script/publish-registries.ts +++ b/packages/opencode/script/publish-registries.ts @@ -4,14 +4,20 @@ import { Script } from "@opencode-ai/script" if (!Script.preview) { // Calculate SHA values - const arm64Sha = await $`sha256sum ./dist/@kilocode/cli-linux-arm64.tar.gz | cut -d' ' -f1` + // kilocode_change start - archives now use '-' instead of '/' and are in archives/ subdirectory + const arm64Sha = await $`sha256sum ./dist/archives/@kilocode-cli-linux-arm64.tar.gz | cut -d' ' -f1` .text() .then((x) => x.trim()) - const x64Sha = await $`sha256sum ./dist/@kilocode/cli-linux-x64.tar.gz | cut -d' ' -f1`.text().then((x) => x.trim()) - const macX64Sha = await $`sha256sum ./dist/@kilocode/cli-darwin-x64.zip | cut -d' ' -f1`.text().then((x) => x.trim()) - const macArm64Sha = await $`sha256sum ./dist/@kilocode/cli-darwin-arm64.zip | cut -d' ' -f1` + const x64Sha = await $`sha256sum ./dist/archives/@kilocode-cli-linux-x64.tar.gz | cut -d' ' -f1` .text() .then((x) => x.trim()) + const macX64Sha = await $`sha256sum ./dist/archives/@kilocode-cli-darwin-x64.zip | cut -d' ' -f1` + .text() + .then((x) => x.trim()) + const macArm64Sha = await $`sha256sum ./dist/archives/@kilocode-cli-darwin-arm64.zip | cut -d' ' -f1` + .text() + .then((x) => x.trim()) + // kilocode_change end const [pkgver, _subver = ""] = Script.version.split(/(-.*)/, 2) diff --git a/packages/opencode/script/publish.ts b/packages/opencode/script/publish.ts index 489bb5ba51..1fe4a2cd79 100755 --- a/packages/opencode/script/publish.ts +++ b/packages/opencode/script/publish.ts @@ -59,14 +59,18 @@ for (const tag of tags) { if (!Script.preview) { // Create archives for GitHub release - await $`mkdir -p dist/@kilocode` // kilocode_change + // kilocode_change start - use absolute paths to avoid issues with scoped package names containing '/' + const archiveDir = `${dir}/dist/archives` + await $`mkdir -p ${archiveDir}` for (const key of Object.keys(binaries)) { + const archiveName = key.replace("/", "-") // @kilocode/cli-linux-arm64 → @kilocode-cli-linux-arm64 if (key.includes("linux")) { - await $`tar -czf ../../${key}.tar.gz *`.cwd(`dist/${key}/bin`) + await $`tar -czf ${archiveDir}/${archiveName}.tar.gz *`.cwd(`dist/${key}/bin`) } else { - await $`zip -r ../../${key}.zip *`.cwd(`dist/${key}/bin`) + await $`zip -r ${archiveDir}/${archiveName}.zip *`.cwd(`dist/${key}/bin`) } } + // kilocode_change end const image = "ghcr.io/kilo-org/kilo" // kilocode_change const platforms = "linux/amd64,linux/arm64" diff --git a/script/publish-start.ts b/script/publish-start.ts index d8564ba973..9e91c2425c 100755 --- a/script/publish-start.ts +++ b/script/publish-start.ts @@ -89,7 +89,7 @@ if (!Script.preview) { 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 create v${Script.version} -d --title "v${Script.version}" --notes ${notes.join("\n") || "No notable changes"} ./packages/opencode/dist/archives/*.zip ./packages/opencode/dist/archives/*.tar.gz` // kilocode_change - archives now in subdirectory const release = await $`gh release view v${Script.version} --json id,tagName`.json() output += `release=${release.id}\n` output += `tag=${release.tagName}\n`