From 6b28b83c3350e9472e610c1b15d6cd0eacce2e38 Mon Sep 17 00:00:00 2001 From: the-Drunken-coder Date: Wed, 24 Jun 2026 10:25:24 -0400 Subject: [PATCH 1/2] fix: require OpenCode release summaries --- .github/workflows/release.yml | 4 +--- README.md | 2 +- scripts/summarize-release-diff.mjs | 14 +++++++------- 3 files changed, 9 insertions(+), 11 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 9f87949..119544e 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -47,7 +47,6 @@ jobs: - name: Generate OpenCode release diff summary if: ${{ steps.release.outputs.release_created == 'true' }} - continue-on-error: true env: OPENCODE_API_KEY: ${{ secrets.OPENCODE_API_KEY }} OPENCODE_MODEL: ${{ vars.OPENCODE_MODEL }} @@ -56,14 +55,13 @@ jobs: - name: Append OpenCode summary to GitHub release if: ${{ steps.release.outputs.release_created == 'true' }} - continue-on-error: true env: GH_TOKEN: ${{ github.token }} RELEASE_TAG_NAME: ${{ steps.release.outputs.tag_name }} run: | if [ ! -s opencode-release-summary.md ]; then echo "No OpenCode release summary was generated." - exit 0 + exit 1 fi gh release view "$RELEASE_TAG_NAME" --json body --jq '.body // ""' > release-notes.md diff --git a/README.md b/README.md index c943838..effcb82 100644 --- a/README.md +++ b/README.md @@ -95,4 +95,4 @@ Npm publishing uses trusted publishing with GitHub Actions OIDC. Configure the p No long-lived `NPM_TOKEN` is required for the release workflow. -If `OPENCODE_API_KEY` is configured as a GitHub Actions secret, the release workflow also asks OpenCode to summarize the diff between the new release tag and the previous release tag, then appends that summary to the GitHub release notes. Set the optional repository variable `OPENCODE_MODEL` to override the default `opencode/kimi-k2` model. +The release workflow requires `OPENCODE_API_KEY` as a GitHub Actions secret so OpenCode can summarize the diff between the new release tag and the previous release tag, then append that summary to the GitHub release notes. If summary generation or release-note appending fails, publishing fails. Set the optional repository variable `OPENCODE_MODEL` to override the default `opencode/kimi-k2` model. diff --git a/scripts/summarize-release-diff.mjs b/scripts/summarize-release-diff.mjs index 083a802..e71543b 100644 --- a/scripts/summarize-release-diff.mjs +++ b/scripts/summarize-release-diff.mjs @@ -9,13 +9,13 @@ const outputPath = "opencode-release-summary.md"; const maxPatchBytes = 120_000; if (!tagName) { - console.log("No release tag was provided; skipping OpenCode release summary."); - process.exit(0); + console.error("No release tag was provided; cannot generate OpenCode release summary."); + process.exit(1); } if (!openCodeApiKey) { - console.log("OPENCODE_API_KEY is not configured; skipping OpenCode release summary."); - process.exit(0); + console.error("OPENCODE_API_KEY is not configured; cannot generate OpenCode release summary."); + process.exit(1); } /** @@ -85,7 +85,7 @@ const prompt = [ const result = spawnSync( "npx", - ["-y", "opencode-ai@1.17.9", "run", "--pure", "--model", model, "--file", contextPath, prompt], + ["-y", "opencode-ai@1.17.9", "run", prompt, "--pure", "--model", model, "--file", contextPath], { encoding: "utf8", env: process.env, @@ -106,8 +106,8 @@ if (result.status !== 0) { const summary = result.stdout.trim(); if (!summary) { - console.log("OpenCode returned an empty summary."); - process.exit(0); + console.error("OpenCode returned an empty summary."); + process.exit(1); } writeFileSync(outputPath, `${summary}\n`); From 13b9f7c1d1bc1f74c1f5c0d2f8e483d3689e0965 Mon Sep 17 00:00:00 2001 From: the-Drunken-coder Date: Wed, 24 Jun 2026 10:32:38 -0400 Subject: [PATCH 2/2] fix: include changelog in npm package --- README.md | 4 ++++ package.json | 3 ++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index effcb82..c27c07d 100644 --- a/README.md +++ b/README.md @@ -76,6 +76,10 @@ Rendering coverage follows the installed `milsymbol` package. The curated semant Image-based reverse lookup is intentionally deferred. +## Changelog + +Release history is maintained in [`CHANGELOG.md`](./CHANGELOG.md) and GitHub Releases. The npm package includes `CHANGELOG.md` so published artifacts carry the release history. + ## Release Automation Releases are managed by Release Please. Commits merged to `main` should use Conventional Commit prefixes: diff --git a/package.json b/package.json index 2ff48c2..32e4a5c 100644 --- a/package.json +++ b/package.json @@ -13,7 +13,8 @@ }, "files": [ "dist", - "README.md" + "README.md", + "CHANGELOG.md" ], "repository": { "type": "git",