|
1 | 1 | # Changelog |
2 | 2 |
|
3 | 3 | All notable changes to this project will be documented in this file. |
| 4 | + |
| 5 | +The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), |
| 6 | +and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html) |
| 7 | +and [Conventional Commits](https://www.conventionalcommits.org/). |
| 8 | + |
| 9 | +## [Unreleased] |
| 10 | + |
| 11 | +### Added |
| 12 | +- Automated changelog generation from conventional commits via semantic-release. |
| 13 | +- GitHub Actions workflow for changelog preview and validation. |
| 14 | +- Conventional commit validation in CI with strict commitlint rules. |
| 15 | + |
| 16 | +### Changed |
| 17 | +- Enforced conventional commit format for all PRs and pushes. |
| 18 | +- Updated `.releaserc` to generate `CHANGELOG.md` on release. |
| 19 | + |
| 20 | +### Documentation |
| 21 | +- Added changelog generation examples and usage instructions. |
| 22 | + |
| 23 | +--- |
| 24 | + |
| 25 | +## Automated Changelog Process |
| 26 | + |
| 27 | +This repository uses [semantic-release](https://github.com/semantic-release/semantic-release) |
| 28 | +with the [conventional commits](https://www.conventionalcommits.org/) specification. |
| 29 | + |
| 30 | +### How It Works |
| 31 | + |
| 32 | +1. Contributors write commits following the conventional commit format: |
| 33 | + - `feat: add new feature` |
| 34 | + - `fix: resolve bug in billing cycle` |
| 35 | + - `docs: update README` |
| 36 | + - `chore: update dependencies` |
| 37 | + |
| 38 | +2. On every push to `main`, the Release workflow triggers semantic-release. |
| 39 | + |
| 40 | +3. semantic-release: |
| 41 | + - Analyzes commit messages since the last release. |
| 42 | + - Determines the next version (`patch`, `minor`, or `major`). |
| 43 | + - Generates release notes from conventional commits. |
| 44 | + - Updates `CHANGELOG.md` automatically. |
| 45 | + - Creates a GitHub Release. |
| 46 | + - Publishes to npm (if configured). |
| 47 | + |
| 48 | +### Commit Format Examples |
| 49 | + |
| 50 | +```bash |
| 51 | +# Feature |
| 52 | +feat(subscription): add grace period support |
| 53 | + |
| 54 | +# Bug fix |
| 55 | +fix(billing): resolve double-charge edge case |
| 56 | + |
| 57 | +# Documentation |
| 58 | +docs(api): add payment webhook examples |
| 59 | + |
| 60 | +# Breaking change |
| 61 | +feat(api)!: change subscription status enum |
| 62 | + |
| 63 | +# Chore |
| 64 | +chore(deps): upgrade react-native to 0.73 |
| 65 | +``` |
| 66 | +
|
| 67 | +### Release Workflow |
| 68 | +
|
| 69 | +| Trigger | Action | |
| 70 | +|---------|--------| |
| 71 | +| Push to `main` | semantic-release analyzes commits and may publish | |
| 72 | +| PR to `main` | commitlint validates commit messages | |
| 73 | +| Manual dispatch | semantic-release dry-run preview | |
| 74 | +
|
| 75 | +### Local Development |
| 76 | +
|
| 77 | +Preview the changelog locally: |
| 78 | +
|
| 79 | +```bash |
| 80 | +npx conventional-changelog-cli -p angular -i CHANGELOG.md -s -r 0 |
| 81 | +``` |
| 82 | +
|
| 83 | +Validate commit messages locally: |
| 84 | +
|
| 85 | +```bash |
| 86 | +npx commitlint --from HEAD~1 --to HEAD --verbose |
| 87 | +``` |
0 commit comments