diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md index 8ac9efeb..52276080 100644 --- a/.github/PULL_REQUEST_TEMPLATE.md +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -21,5 +21,5 @@ Feel free to leave unchecked or remove the lines that are not applicable. - [ ] Reviewed and approved Chromatic visual regression tests in CI diff --git a/AGENTS.md b/AGENTS.md index 7d22022f..e2bae8ff 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -109,11 +109,12 @@ For generic React Testing Library patterns (component tests, hook tests, provide ## Commits and PRs - PR titles must follow [conventional commits](https://www.conventionalcommits.org/): `feat:`, `fix:`, `chore:`, `refactor:`, `test:`, `docs:`, etc. -- `feat:` triggers a minor version bump, `fix:` triggers a patch, `feat!:` or `fix!:` triggers a major (breaking) -- Versioning is automated by release-please based on PR title +- `feat:` triggers a minor version bump, `fix:` and `perf:` trigger a patch, any type with `!` or a `BREAKING CHANGE:` footer triggers a major (breaking) +- Versioning is automated by semantic-release based on PR title - Pre-commit hooks run Prettier, ESLint, and React Compiler tracking - do not skip them + # AGENTS > [!WARNING] @@ -220,4 +221,5 @@ When asked to create a pull request, follow this mandatory process: ## Enforcement These guidelines are **non-negotiable**. Deviation from this process constitutes a failure to follow core instructions. When in doubt, ask for clarification. + diff --git a/README.md b/README.md index d5dcdba8..26522078 100644 --- a/README.md +++ b/README.md @@ -203,34 +203,31 @@ When you open a GitHub PR, you'll notice the "UI Review" and "UI Tests" CI steps # Releasing -This project uses [release-please](https://github.com/googleapis/release-please) to automate version management and package publishing. +This project uses [semantic-release](https://github.com/semantic-release/semantic-release) to automate version management and package publishing. ## How it works 1. Make your changes using [Conventional Commits](https://www.conventionalcommits.org/): + - Any type below with an added `!` suffix (e.g. `feat!:`, `fix!:`) or a `BREAKING CHANGE:` footer for breaking changes (major version bump) - `feat:` for new features (minor version bump) - `fix:` for bug fixes (patch version bump) - - `style:` for code style changes - - `perf:` for performance improvements + - `perf:` for performance improvements (patch version bump) - `refactor:` for refactoring code - `test:` for adding/updating tests - `build:` for build/dependency changes - `docs:` for documentation changes - `ci:` for CI changes - `revert:` for reverting previous commits - - `feat!:` or `fix!:` for breaking changes (major version bump) - `chore:` for maintenance tasks (NOTE: these are not included in the changelog) -2. When commits are pushed to `main`: - - Release-please automatically creates/updates a release PR - - The PR includes version bump and changelog updates - - Review the PR and merge when ready - -3. After merging the release PR: - - A new GitHub release is automatically created - - A new tag is created - - The `publish` workflow is triggered - - The package is published to npm and GitHub Packages - - Storybook documentation is automatically updated + Any type can carry an optional scope, e.g. `feat(button):` or `perf(tooltip)!:`. + +2. When a PR is merged to `main`, the [Package Release](.github/workflows/publish-package-release.yml) workflow runs and semantic-release: + - Reads the merged commit's conventional-commit type to determine the version bump + - Updates `CHANGELOG.md`, `package.json`, and `package-lock.json`, and commits them back to `main` + - Creates a new tag and GitHub release + - Publishes the package to npm and GitHub Packages + +A merge triggers a release only when it includes a type marked with a version bump above; otherwise nothing is published. The storybook hosted on GitHub pages will be automatically updated on each push to `main`. If there's a problem, try running the action manually from the [Actions settings](https://github.com/Doist/reactist/actions).