ci: add release workflow, release script and smoke script #15

Merged
haylan merged 2 commits from feat/release into main 2026-10-03 17:30:13 +00:00
Owner

Step 4 of the build order in docs/spec.md.

  • scripts/release.ts: reads the latest ## [x.y.z] heading in CHANGELOG.md (skips [Unreleased]), stages package.json with that version plus dist/, tars it, checks the registry (GET), skips with exit 0 if the version exists, else PUTs the npm publish payload to the Gitea registry. No npm publish, no dependencies; the repo keeps its dev version
  • .gitea/workflows/release.yml: workflow_dispatch only, guarded to main, runs npm ci, npm test, npm run build, then the script. Token is secrets.PACKAGE_TOKEN, falling back to the job token
  • scripts/smoke.ts (npm run smoke -- "query"): one real search against CRW_API_URL, prints the raw response shape and the mapped results
  • Tests for the pure parts (version parsing, name encoding, publish payload); 36 tests total. I also ran the script against a local mock registry: first run published, second skipped as already published, tarball contents are package/package.json and package/dist/

Still to verify on the real registry (spec verification item 5): that the job token can write packages; otherwise add a write:package secret named PACKAGE_TOKEN.

🤖 Generated with Claude Code

Step 4 of the build order in `docs/spec.md`. - `scripts/release.ts`: reads the latest `## [x.y.z]` heading in `CHANGELOG.md` (skips `[Unreleased]`), stages `package.json` with that version plus `dist/`, tars it, checks the registry (`GET`), skips with exit 0 if the version exists, else `PUT`s the npm publish payload to the Gitea registry. No `npm publish`, no dependencies; the repo keeps its dev version - `.gitea/workflows/release.yml`: `workflow_dispatch` only, guarded to `main`, runs `npm ci`, `npm test`, `npm run build`, then the script. Token is `secrets.PACKAGE_TOKEN`, falling back to the job token - `scripts/smoke.ts` (`npm run smoke -- "query"`): one real search against `CRW_API_URL`, prints the raw response shape and the mapped results - Tests for the pure parts (version parsing, name encoding, publish payload); 36 tests total. I also ran the script against a local mock registry: first run published, second skipped as already published, tarball contents are `package/package.json` and `package/dist/` Still to verify on the real registry (spec verification item 5): that the job token can write packages; otherwise add a `write:package` secret named `PACKAGE_TOKEN`. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
haylan added 1 commit 2026-10-03 17:29:42 +00:00
haylan added 1 commit 2026-10-03 17:30:10 +00:00
Merge branch 'main' into feat/release
check / check (pull_request) Successful in 33s
e8a88180eb
haylan merged commit ccab3c097f into main 2026-10-03 17:30:13 +00:00
haylan deleted branch feat/release 2026-10-03 17:30:13 +00:00
Sign in to join this conversation.
No Reviewers
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: haylan/fastcrw-opencode-websearch#15