Implement the following plan: Plan: Add Release Please for Automated CLI Releases…
- User
Implement the following plan:
Plan: Add Release Please for Automated CLI Releases
Context
The
rudelCLI (published to npm asrudel, currently v0.1.4) is released manually viascripts/release-cli.ts, which requires interactive npm OTP and running the script locally. The goal is to automate changelog generation from conventional commits and automate npm publishing when a Release PR is merged.Changes
1. Create
release-please-config.json(new file, root)Release Please manifest configuration. Only
apps/cliis releasable. Tag format matches existingrudel@X.Y.Zconvention.json{ "$schema": "https://raw.githubusercontent.com/googleapis/release-please/main/schemas/config.json", "include-v-in-tag": false, "tag-separator": "@", "packages": { "apps/cli": { "release-type": "node", "component": "rudel", "changelog-path": "CHANGELOG.md", "extra-files": [ { "type": "generic", "path": "src/app.ts" } ] } } }2. Create
.release-please-manifest.json(new file, root)Tracks current version. Initialized to match the latest published version.
json{ "apps/cli": "0.1.4" }3. Annotate
apps/cli/src/app.ts(line 29)Add
// x-release-please-versionso Release Please auto-updates the hardcoded version string alongsidepackage.json.diff- currentVersion: "0.1.4", + currentVersion: "0.1.4", // x-release-please-version4. Create
.github/workflows/release.yml(new file)Two jobs:
- release-please: Runs on push to
main. Creates/updates a Release PR with changelog + version bump. When the Release PR is merged, creates a GitHub Release + tag. - publish-cli: Conditional on
release_created. Checks out, installs, builds, and runsbun publishwith .
- release-please: Runs on push to
Assistant
I'll implement the plan. Let me start by reading the files I need to edit and checking existing patterns.
Assistant
Let me check the existing CI workflow for patterns to match, and the existing release script.
Assistant
Good, I have all the context I need. Now let me create all the files.
Assistant
Now let me create the two workflow files.
Assistant
Now update
CLAUDE.mdwith the Releasing section. I'll add it before the "Pre-Push Checklist" section.Assistant
Now let me run verification.
Assistant
Biome wants tabs instead of spaces in the JSON files. Let me fix the formatting.
Assistant
Biome wants tabs for indentation. Let me rewrite both files with tabs.
Assistant
The lint and all tests/type checks pass now. The
@rudel/web:buildfailure is a pre-existing issue with missing type declarations forreact-markdown/remark-gfminMarkdownContent.tsx— unrelated to my changes. Let me confirm this is pre-existing.Assistant
Confirmed — the
@rudel/webbuild failure is pre-existing onmainand not caused by my changes.Here's a summary of everything implemented:
File Action release-please-config.jsonCreated — manifest config scoped to apps/cli.release-please-manifest.jsonCreated — tracks current version 0.1.4apps/cli/src/app.tsEdited — added // x-release-please-versionannotation on line 29.github/workflows/release.ymlCreated — Release Please + npm publish on merge to main.github/workflows/pr-title.ymlCreated — enforces conventional commit PR titles CLAUDE.mdEdited — added "Releasing" section before "Pre-Push Checklist" Manual step required: Add an
NPM_TOKENsecret to the GitHub repo (npm Automation-type granular access token scoped to therudelpackage).- User
ah we cant do the release automatically, since I have an OTP enabled for my NPM account. so remove the auomatic release part.... I need to run it manually locally. Update everythign accordingly
Assistant
Done. Removed the
publish-clijob from the release workflow — it now only runs Release Please to manage the Release PR, changelog, version bumps, and GitHub Release/tag. npm publishing remains manual via OTP locally.Changes:
.github/workflows/release.yml— removed thepublish-clijob and unused outputsCLAUDE.md— updated the Releasing section to document the manual publish step after merging a Release PR