-
Notifications
You must be signed in to change notification settings - Fork 12
ci: add commitlint, Husky, and release-please #2339
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
283d2bf
0f339b8
f78030f
dc179e3
a55e8ec
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,12 +1,11 @@ | ||
| # CLI Version Management | ||
|
|
||
| **CRITICAL: Bump the version on every CLI change!** | ||
| **Version bumps are handled automatically by release-please.** Do NOT manually edit the version in `packages/cli/package.json`. | ||
|
|
||
| - **ANY change to `packages/cli/` requires a version bump** in `packages/cli/package.json` | ||
| - Use semantic versioning: | ||
| - **Patch** (0.2.X → 0.2.X+1): Bug fixes, minor improvements, documentation | ||
| - **Minor** (0.X.0 → 0.X+1.0): New features, significant improvements | ||
| - **Major** (X.0.0 → X+1.0.0): Breaking changes | ||
| - The CLI has auto-update enabled — users get new versions immediately on next run | ||
| - Version bumps ensure users always have the latest fixes and features | ||
| - Use **conventional commit types** to control the bump level: | ||
| - `fix:` → patch bump (0.15.17 → 0.15.18) | ||
| - `feat:` → minor bump (0.15.17 → 0.16.0) | ||
| - `feat!:` or `BREAKING CHANGE:` → major bump (but while pre-1.0, treated as minor: 0.15.17 → 0.16.0) | ||
| - release-please opens a PR that accumulates unreleased changes and bumps the version | ||
| - Merging that PR creates a GitHub release, which triggers the CLI build + publish workflow | ||
| - **NEVER commit `packages/cli/cli.js`** — it is a build artifact (already in `.gitignore`). It is produced during releases, not checked into the repo. Do NOT use `git add -f packages/cli/cli.js`. |
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🚩 Stale release notes text still references 'every push to main' Line 57 of Was this helpful? React with 👍 or 👎 to provide feedback. |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,28 @@ | ||
| name: Commitlint | ||
|
|
||
| on: | ||
| pull_request: | ||
| branches: [main] | ||
| types: [opened, edited, synchronize, reopened] | ||
|
|
||
| jobs: | ||
| lint: | ||
| name: Validate PR title | ||
| runs-on: ubuntu-latest | ||
|
|
||
| steps: | ||
| - name: Checkout code | ||
| uses: actions/checkout@v4 | ||
|
|
||
| - name: Setup Bun | ||
| uses: oven-sh/setup-bun@v2 | ||
|
|
||
| - name: Install commitlint | ||
| run: bun install --no-save @commitlint/cli @commitlint/config-conventional | ||
|
|
||
| - name: Lint PR title | ||
| env: | ||
| PR_TITLE: ${{ github.event.pull_request.title }} | ||
| run: | | ||
| printf '%s\n' "$PR_TITLE" > /tmp/pr_title.txt | ||
| bunx commitlint < /tmp/pr_title.txt |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,28 @@ | ||
| name: Release Please | ||
|
|
||
| on: | ||
| push: | ||
| branches: [main] | ||
|
|
||
| permissions: | ||
| contents: write | ||
| pull-requests: write | ||
|
|
||
| jobs: | ||
| release: | ||
| name: Create release PR | ||
| runs-on: ubuntu-latest | ||
|
|
||
| steps: | ||
| - uses: actions/create-github-app-token@v2 | ||
| id: app-token | ||
| with: | ||
| app-id: ${{ secrets.GH_APP_ID }} | ||
| private-key: ${{ secrets.GH_APP_PRIVATE_KEY }} | ||
|
|
||
| - name: Run release-please | ||
| uses: googleapis/release-please-action@v4 | ||
| with: | ||
| config-file: release-please-config.json | ||
| manifest-file: .release-please-manifest.json | ||
devin-ai-integration[bot] marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| token: ${{ steps.app-token.outputs.token }} | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| bunx --no-install commitlint --edit "$1" |
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
| @@ -0,0 +1,3 @@ | ||||||
| { | ||||||
| "packages/cli": "0.15.17" | ||||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🔴 release-please manifest version (0.15.17) is out of sync with actual package.json version (0.15.18) The newly introduced
Suggested change
Was this helpful? React with 👍 or 👎 to provide feedback. |
||||||
| } | ||||||
Large diffs are not rendered by default.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,23 @@ | ||
| export default { | ||
| extends: ["@commitlint/config-conventional"], | ||
| rules: { | ||
| "type-enum": [ | ||
| 2, | ||
| "always", | ||
| [ | ||
| "feat", | ||
| "fix", | ||
| "docs", | ||
| "style", | ||
| "refactor", | ||
| "perf", | ||
| "test", | ||
| "build", | ||
| "ci", | ||
| "chore", | ||
| "revert", | ||
| ], | ||
| ], | ||
| "header-max-length": [2, "always", 100], | ||
| }, | ||
| }; |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,22 @@ | ||
| { | ||
| "packages": { | ||
| "packages/cli": { | ||
| "release-type": "node", | ||
| "bump-minor-pre-major": true, | ||
louisgv marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| "changelog-sections": [ | ||
| { "type": "feat", "section": "Features" }, | ||
| { "type": "fix", "section": "Bug Fixes" }, | ||
| { "type": "perf", "section": "Performance" }, | ||
| { "type": "refactor", "section": "Refactoring" }, | ||
| { "type": "test", "section": "Tests", "hidden": true }, | ||
| { "type": "docs", "section": "Documentation", "hidden": true }, | ||
| { "type": "chore", "section": "Miscellaneous", "hidden": true }, | ||
| { "type": "ci", "section": "CI", "hidden": true }, | ||
| { "type": "build", "section": "Build", "hidden": true }, | ||
| { "type": "style", "section": "Styles", "hidden": true }, | ||
| { "type": "revert", "section": "Reverts" } | ||
| ] | ||
| } | ||
| }, | ||
| "$schema": "https://raw.githubusercontent.com/googleapis/release-please/main/schemas/config.json" | ||
| } | ||
Uh oh!
There was an error while loading. Please reload this page.