Skip to content

feat(publish): reconstruct opencode-stable publish pipeline + CI (Plan B)#6

Merged
ranxianglei merged 3 commits into
masterfrom
ci/opencode-stable-publish
Jul 6, 2026
Merged

feat(publish): reconstruct opencode-stable publish pipeline + CI (Plan B)#6
ranxianglei merged 3 commits into
masterfrom
ci/opencode-stable-publish

Conversation

@ranxianglei

Copy link
Copy Markdown
Owner

Summary

Reconstructs the fork-specific publish infrastructure that was overwritten by an upstream sync (documented in the new AGENTS.md §4.5). This is Plan B from issue #5: a fork-specific CI pipeline on this mirror that publishes opencode-stable to npm, triggered by tags.

Closes the blocker that prevented a clean 1.14.42 release: the existing build.ts / publish.ts / postinstall.mjs were upstream's versions producing the wrong package names (opencode-ai, opencode-{platform}) — running them would attempt to publish sst-owned packages and fail.

Changes

docs(agents): add fork-level AGENTS.md (feac1fed2)

  • Comprehensive fork spec modeled on opencode-acp's AGENTS.md: project overview, architecture, the OPENCODE_VERSION session-invalidation pitfall, storage/data safety, 3-remote layout, broken-publish-infra history, snapshot-fix divergence log, git safety rules, mandatory pre-publish checklist.

feat(publish): reconstruct opencode-stable publish pipeline + CI (bc7f17269)

  • build.ts: platform package names get -stable suffix; platform package.json enriched (description / files / license to match what's published at 1.14.41); new --no-windows flag (the fork ships no Windows packages).
  • publish.ts: umbrella = opencode-stable with full metadata + stub bin/opencode.exe (postinstall overwrites it with the real platform binary); filters Windows binaries; drops upstream's Docker / AUR / Homebrew steps (those target anomalyco/* infrastructure and would fail here).
  • postinstall.mjs: restored verbatim from the published opencode-stable@1.14.41 tarball — the full avx2/musl/baseline fallback logic for resolving the correct platform binary (the upstream version that overwrote it had no -stable names and no fallback).
  • .github/workflows/publish-stable.yml (new): tag-triggered (v*) workflow, gated to this repo, single ubuntu job → builds 9 cross-compile targets (--no-windows) → publishes via NPM_TOKEN secret.

Verification

  • bun run typecheck (tsgo --noEmit) → exit 0, 0 errors
  • publish-stable.yml validated as YAML
  • postinstall.mjs syntax valid (node parse)
  • build.ts region + publish.ts reviewed end-to-end

To release 1.14.42 (after this merges)

  1. Add the NPM_TOKEN secret to this repo (Settings → Secrets → Actions). The token must have publish rights for opencode-stable + the 9 opencode-*-stable packages (owner: ranxianglei).
  2. Merge this PR.
  3. Tag and push:
    git tag -a v1.14.42 -m "release v1.14.42"
    git push origin v1.14.42
  4. Watch the publish-stable workflow build the 9 binaries and publish 10 packages (1 umbrella + 9 platform).

⚠️ No --single flag in CI — it cross-compiles all 9 targets. The OPENCODE_VERSION env var is set from the tag so existing sessions stay valid.

Comprehensive fork specification modeled on opencode-acp's AGENTS.md,
covering: project overview & tech stack, monorepo architecture, the version-
pinning pitfall (OPENCODE_VERSION env var — omitting it invalidates all
sessions), storage paths & data safety, fork-specific realities (3 remotes,
broken publish infrastructure, snapshot-fix divergence history), git safety
rules, and a mandatory pre-publish checklist.
Reconstructs the fork-specific publish infrastructure that was overwritten
by an upstream sync (see AGENTS.md §4.5). Restores the -stable npm naming
across build/publish/postinstall and adds a dedicated CI workflow on the
GitHub mirror.

- build.ts: platform package names get -stable suffix; enrich platform
  package.json (description/files/license); add --no-windows flag (fork
  ships no Windows packages)
- publish.ts: umbrella = opencode-stable with full metadata, stub
  bin/opencode.exe (postinstall overwrites it), filters Windows, drops
  upstream Docker/AUR/Homebrew steps (target anomalyco infra)
- postinstall.mjs: restore verbatim from published 1.14.41 tarball — full
  avx2/musl/baseline fallback logic for resolving the right platform binary
- publish-stable.yml: new tag-triggered (v*) workflow on the GitHub mirror,
  single ubuntu job, builds 9 cross-compile targets, publishes via NPM_TOKEN
@github-actions

github-actions Bot commented Jul 6, 2026

Copy link
Copy Markdown
Contributor

This PR doesn't fully meet our contributing guidelines and PR template.

What needs to be fixed:

  • PR description is missing required template sections. Please use the PR template.

Please edit this PR description to address the above within 2 hours, or it will be automatically closed.

If you believe this was flagged incorrectly, please let a maintainer know.

The fork mirror (ranxianglei/opencode-stable) does not have Blacksmith
configured, so all jobs using blacksmith-4vcpu-* runners hang forever
in QUEUED state. Swap every occurrence across all 22 workflow files:
  blacksmith-4vcpu-ubuntu-2404      -> ubuntu-latest
  blacksmith-4vcpu-ubuntu-2404-arm  -> ubuntu-latest
  blacksmith-4vcpu-windows-2025     -> windows-latest

This unblocks test.yml (unit/e2e), typecheck.yml, and every other
workflow so CI actually runs on the fork.
@ranxianglei ranxianglei merged commit 3b7528d into master Jul 6, 2026
5 of 6 checks passed
@ranxianglei ranxianglei deleted the ci/opencode-stable-publish branch July 6, 2026 07:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant