|
| 1 | +# Release Please Configuration Documentation |
| 2 | + |
| 3 | +This document explains the configuration in `.github/release-please-config.json`. |
| 4 | + |
| 5 | +## Core Configuration |
| 6 | + |
| 7 | +### Schema |
| 8 | + |
| 9 | +```json |
| 10 | +"$schema": "https://raw.githubusercontent.com/googleapis/release-please/main/schemas/config.json" |
| 11 | +``` |
| 12 | + |
| 13 | +Enables IDE autocomplete, validation, and inline documentation for the configuration file. |
| 14 | + |
| 15 | +### Bootstrap SHA |
| 16 | + |
| 17 | +```json |
| 18 | +"bootstrap-sha": "HEAD" |
| 19 | +``` |
| 20 | + |
| 21 | +Tells release-please to start tracking releases from the current HEAD commit. This is used when setting up release-please for the first time in an existing repository with release history. |
| 22 | + |
| 23 | +### Tag Separator |
| 24 | + |
| 25 | +```json |
| 26 | +"tag-separator": "@" |
| 27 | +``` |
| 28 | + |
| 29 | +Defines the separator used in git tags. With `@`, tags are formatted as `eds-core-react@0.49.0` instead of `eds-core-react-v0.49.0`. This matches our existing tag format in the repository. |
| 30 | + |
| 31 | +## Package Configuration |
| 32 | + |
| 33 | +Each package in the monorepo must be explicitly configured: |
| 34 | + |
| 35 | +```json |
| 36 | +"packages/eds-core-react": { |
| 37 | + "release-type": "node", |
| 38 | + "package-name": "@equinor/eds-core-react", |
| 39 | + "component": "eds-core-react" |
| 40 | +} |
| 41 | +``` |
| 42 | + |
| 43 | +- **Path key** (`packages/eds-core-react`): The relative path from repo root to the package |
| 44 | +- **`release-type`**: Set to `"node"` for npm packages. This determines how version bumping works |
| 45 | +- **`package-name`**: The npm package name (with scope) |
| 46 | +- **`component`**: Used in git tags and must match the tag format. For `eds-core-react`, tags will be `eds-core-react@x.y.z` |
| 47 | + |
| 48 | +### All Configured Packages |
| 49 | + |
| 50 | +We currently track these packages for releases: |
| 51 | + |
| 52 | +1. `@equinor/eds-core-react` - Core React component library |
| 53 | +2. `@equinor/eds-data-grid-react` - Data grid component |
| 54 | +3. `@equinor/eds-icons` - Icon library |
| 55 | +4. `@equinor/eds-lab-react` - Experimental components |
| 56 | +5. `@equinor/eds-tokens` - Design tokens and variables |
| 57 | +6. `@equinor/eds-utils` - Shared utilities |
| 58 | + |
| 59 | +## Pull Request Configuration |
| 60 | + |
| 61 | +### Combined Releases |
| 62 | + |
| 63 | +```json |
| 64 | +"separate-pull-requests": false |
| 65 | +``` |
| 66 | + |
| 67 | +Creates **one combined PR** with all packages that have changes, rather than separate PRs per package. When this PR is merged, release-please will create separate GitHub releases for each package automatically. |
| 68 | + |
| 69 | +### PR Title Pattern |
| 70 | + |
| 71 | +```json |
| 72 | +"pull-request-title-pattern": "chore: release${component}" |
| 73 | +``` |
| 74 | + |
| 75 | +Defines the title format for release PRs. The `${component}` placeholder is replaced with package names. With combined PRs, this shows all affected components. |
| 76 | + |
| 77 | +### PR Header |
| 78 | + |
| 79 | +```json |
| 80 | +"pull-request-header": "## Release PR\n\nThis PR was automatically generated..." |
| 81 | +``` |
| 82 | + |
| 83 | +Custom message added to the top of release PRs. Used to provide instructions for what to do after merging. |
| 84 | + |
| 85 | +### PR Label |
| 86 | + |
| 87 | +```json |
| 88 | +"label": "autorelease: pending" |
| 89 | +``` |
| 90 | + |
| 91 | +Automatically adds this label to release PRs for easy filtering and identification. |
| 92 | + |
| 93 | +## Changelog Configuration |
| 94 | + |
| 95 | +### Changelog Sections |
| 96 | + |
| 97 | +```json |
| 98 | +"changelog-sections": [ |
| 99 | + { "type": "feat", "section": "✨ Added" }, |
| 100 | + { "type": "fix", "section": "🐛 Fixed" }, |
| 101 | + ... |
| 102 | +] |
| 103 | +``` |
| 104 | + |
| 105 | +Maps conventional commit types to changelog sections with emojis: |
| 106 | + |
| 107 | +- **feat** → ✨ Added (new features) |
| 108 | +- **fix** → 🐛 Fixed (bug fixes) |
| 109 | +- **docs** → 📝 Changed (documentation updates) |
| 110 | +- **perf** → ⚡ Performance Improvements |
| 111 | +- **refactor** → ♻️ Refactoring (code restructuring) |
| 112 | +- **chore** → 🔧 Chores (maintenance tasks, dependency updates) |
| 113 | +- **ci** → 👷 CI/CD (pipeline/workflow changes) |
| 114 | +- **build** → 📦 Build System (build configuration) |
| 115 | +- **test** → ✅ Tests (test additions/changes) |
| 116 | + |
| 117 | +All types are visible in CHANGELOG files. Note: There's no `hidden` property, so all commit types appear in both CHANGELOGs and GitHub releases. (This is why we do Github Releases manually - to be able to filter out chores, CI/CD changes, and build system updates that are relevant for maintainers but not for end users.) |
| 118 | + |
| 119 | +### Changelog Path |
| 120 | + |
| 121 | +```json |
| 122 | +"changelog-path": "CHANGELOG.md" |
| 123 | +``` |
| 124 | + |
| 125 | +Relative path for the changelog file in each package. Release-please will create/update `packages/[package-name]/CHANGELOG.md`. |
| 126 | + |
| 127 | +### Release Search Depth |
| 128 | + |
| 129 | +```json |
| 130 | +"release-search-depth": 500 |
| 131 | +``` |
| 132 | + |
| 133 | +How many commits back to search when looking for the last release. Increase this if you have a very long commit history between releases. |
| 134 | + |
| 135 | +## Version Bumping Rules |
| 136 | + |
| 137 | +### Pre-1.0.0 Behavior |
| 138 | + |
| 139 | +```json |
| 140 | +"bump-minor-pre-major": true |
| 141 | +``` |
| 142 | + |
| 143 | +Before version 1.0.0, `feat:` commits bump the minor version (0.x.0) instead of major. This follows the convention that pre-1.0.0 versions are still in development. |
| 144 | + |
| 145 | +```json |
| 146 | +"bump-patch-for-minor-pre-major": false |
| 147 | +``` |
| 148 | + |
| 149 | +Ensures that breaking changes (indicated by `BREAKING CHANGE:` in commit message) still bump minor version pre-1.0.0, not patch. |
| 150 | + |
| 151 | +**Version Bump Examples (pre-1.0.0):** |
| 152 | + |
| 153 | +- `fix: bug` → 0.1.0 → 0.1.1 (patch) |
| 154 | +- `feat: new feature` → 0.1.0 → 0.2.0 (minor) |
| 155 | +- `feat!: breaking change` → 0.1.0 → 0.2.0 (minor, not major) |
| 156 | + |
| 157 | +**Version Bump Examples (1.0.0+):** |
| 158 | + |
| 159 | +- `fix: bug` → 1.0.0 → 1.0.1 (patch) |
| 160 | +- `feat: new feature` → 1.0.0 → 1.1.0 (minor) |
| 161 | +- `feat!: breaking change` → 1.0.0 → 2.0.0 (major) |
| 162 | + |
| 163 | +## GitHub Release Configuration |
| 164 | + |
| 165 | +```json |
| 166 | +"skip-github-release": true |
| 167 | +``` |
| 168 | + |
| 169 | +When `true`, release-please will NOT automatically create GitHub releases when the release PR is merged. This means: |
| 170 | + |
| 171 | +- Release PRs are created automatically ✅ |
| 172 | +- Version bumps happen automatically ✅ |
| 173 | +- CHANGELOGs are updated automatically ✅ |
| 174 | +- GitHub releases must be created manually ❌ |
| 175 | + |
| 176 | +Set to `false` if you want automatic GitHub release creation. |
| 177 | + |
| 178 | +## How It Works Together |
| 179 | + |
| 180 | +1. **Developer makes conventional commits** (e.g., `feat(eds-icons): add new icon`) |
| 181 | +2. **Release-please monitors the branch** and detects releasable changes |
| 182 | +3. **Release PR is created** with: |
| 183 | + - Version bumps in affected `package.json` files |
| 184 | + - Updated CHANGELOGs for affected packages |
| 185 | + - Summary of all changes |
| 186 | +4. **Team reviews and merges the PR** |
| 187 | +5. **Automatic publish workflow triggers** (separate workflow) |
| 188 | +6. **Packages are published to npm** |
| 189 | +7. **GitHub releases are created manually** (because `skip-github-release: true`) |
| 190 | + |
| 191 | +## Multi-Package Example |
| 192 | + |
| 193 | +If you make these commits: |
| 194 | + |
| 195 | +```bash |
| 196 | +feat(eds-icons): add arrow-up icon |
| 197 | +fix(eds-core-react): fix button padding |
| 198 | +feat(eds-tokens): add new color tokens |
| 199 | +``` |
| 200 | + |
| 201 | +Release-please will create ONE PR that: |
| 202 | + |
| 203 | +- Bumps `eds-icons` from 0.22.0 → 0.23.0 |
| 204 | +- Bumps `eds-core-react` from 0.49.0 → 0.50.0 |
| 205 | +- Bumps `eds-tokens` from 0.10.0 → 0.11.0 |
| 206 | +- Updates all three CHANGELOGs |
| 207 | + |
| 208 | +When merged, three separate GitHub releases will be created (if `skip-github-release: false`). |
| 209 | + |
| 210 | +## Commit Scope Matching |
| 211 | + |
| 212 | +The `component` field must match commit scopes for release-please to detect which packages are affected: |
| 213 | + |
| 214 | +```bash |
| 215 | +# These commits affect the corresponding packages: |
| 216 | +feat(eds-core-react): ... → packages/eds-core-react |
| 217 | +fix(eds-icons): ... → packages/eds-icons |
| 218 | +docs(eds-tokens): ... → packages/eds-tokens |
| 219 | + |
| 220 | +# Multiple packages in one commit: |
| 221 | +feat(eds-icons, eds-core-react): ... → both packages |
| 222 | +``` |
| 223 | + |
| 224 | +## Related Files |
| 225 | + |
| 226 | +- **Config**: `.github/release-please-config.json` (this documentation) |
| 227 | +- **Manifest**: `.github/release-please-manifest.json` (tracks current versions) |
| 228 | +- **Workflow**: `.github/workflows/release-please.yml` (triggers release-please) |
| 229 | +- **Publish**: `.github/workflows/trigger-publish.yml` (publishes after release) |
| 230 | + |
| 231 | +## Useful Links |
| 232 | + |
| 233 | +- [Release Please Documentation](https://github.com/googleapis/release-please) |
| 234 | +- [Conventional Commits](https://www.conventionalcommits.org/) |
| 235 | +- [Semantic Versioning](https://semver.org/) |
0 commit comments