Merge pull request #95 from Kilo-Org/catrielmuller/fix-release-archives-2
Fix release archives
This commit is contained in:
@@ -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
|
||||
@@ -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"
|
||||
|
||||
@@ -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)
|
||||
|
||||
|
||||
@@ -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"
|
||||
|
||||
@@ -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`
|
||||
|
||||
Reference in New Issue
Block a user