|
| 1 | +# Release Please Workflow |
| 2 | + |
| 3 | +This document explains the automated release and publishing workflow for the UI5 CLI monorepo using [Release Please](https://github.com/googleapis/release-please). |
| 4 | + |
| 5 | +## Table of Contents |
| 6 | + |
| 7 | +- [Overview](#overview) |
| 8 | +- [Workflow Architecture](#workflow-architecture) |
| 9 | +- [Release Please Configuration](#release-please-configuration) |
| 10 | + |
| 11 | +## Overview |
| 12 | + |
| 13 | +The UI5 CLI uses an automated release workflow powered by Release Please to: |
| 14 | +1. **Automatically generate release PRs** based on Conventional Commits |
| 15 | +2. **Update version numbers** across all workspace packages synchronously |
| 16 | +3. **Generate changelogs** for each package |
| 17 | +4. **Publish packages to npm** sequentially to respect dependency order |
| 18 | +5. **Create GitHub releases** with release notes |
| 19 | + |
| 20 | +## Workflow Architecture |
| 21 | + |
| 22 | + |
| 23 | + |
| 24 | +The workflow consists of three main jobs: |
| 25 | + |
| 26 | +### 1. Release Please Job |
| 27 | +- **Trigger**: Push to `main` branch |
| 28 | +- **Purpose**: Create/update release PR with version bumps and changelogs |
| 29 | +- **Output**: Information about created releases and PRs |
| 30 | + |
| 31 | +### 2. Publish Packages Job |
| 32 | +- **Trigger**: When release PR is merged to `main` |
| 33 | +- **Action**: Developer merges the release PR in GitHub |
| 34 | +- **Result**: |
| 35 | + - Release Please creates releases & tags in GitHub for every package |
| 36 | + - Packages are published to npm sequentially (logger → fs → builder → server → project) |
| 37 | +- **Strategy**: Sequential execution (`max-parallel: 1`) to ensure dependencies exist before dependents |
| 38 | + |
| 39 | +### 3. Publish CLI Job |
| 40 | +- **Trigger**: After all other packages are published |
| 41 | +- **Purpose**: Generate `npm-shrinkwrap.json` and publish the CLI package |
| 42 | +- **Dependency**: Requires all other packages to be available on npm registry |
| 43 | + |
| 44 | +## Release Please Configuration |
| 45 | + |
| 46 | +The configuration is defined in [`release-please-config.json`](../release-please-config.json). Below is a detailed explanation of each property: |
| 47 | + |
| 48 | + |
| 49 | +### Pull Request Title Pattern |
| 50 | + |
| 51 | +```json |
| 52 | +"group-pull-request-title-pattern": "release: UI5 CLI packages ${branch}" |
| 53 | +``` |
| 54 | + |
| 55 | +**Purpose**: Defines the title format for release pull requests in monorepos. |
| 56 | + |
| 57 | +**Behavior**: |
| 58 | +- Uses `${branch}` placeholder which gets replaced with the branch name |
| 59 | +- For linked versions, Release Please creates a single PR for all packages |
| 60 | + |
| 61 | +**Documentation**: [Grouping Pull Requests](https://github.com/googleapis/release-please?tab=readme-ov-file#group-pull-request-title-pattern) |
| 62 | + |
| 63 | +--- |
| 64 | + |
| 65 | +### Release Type |
| 66 | + |
| 67 | +```json |
| 68 | +"release-type": "node" |
| 69 | +``` |
| 70 | + |
| 71 | +**Purpose**: Specifies the project type, which determines default behavior for versioning and changelog generation. |
| 72 | + |
| 73 | +**Behavior**: |
| 74 | +- Uses Node.js/npm conventions |
| 75 | +- Updates `package.json` version field |
| 76 | +- Generates conventional changelog format |
| 77 | +- Handles npm-specific files |
| 78 | + |
| 79 | +**Documentation**: [Release Types](https://github.com/googleapis/release-please?tab=readme-ov-file#release-types-supported) |
| 80 | + |
| 81 | +--- |
| 82 | + |
| 83 | +### Always Update |
| 84 | + |
| 85 | +```json |
| 86 | +"always-update": true |
| 87 | +``` |
| 88 | + |
| 89 | +**Purpose**: Ensures the release PR is updated with every commit to the main branch. |
| 90 | + |
| 91 | +**Behavior**: |
| 92 | +- Scans commits since last release |
| 93 | +- Updates PR description, version numbers, and changelogs |
| 94 | +- Prevents stale release PRs |
| 95 | + |
| 96 | +**Documentation**: This is a standard boolean flag in Release Please for keeping PRs current. |
| 97 | + |
| 98 | +--- |
| 99 | + |
| 100 | +### Pull Request Header |
| 101 | + |
| 102 | +```json |
| 103 | +"pull-request-header": ":tractor: New release prepared" |
| 104 | +``` |
| 105 | + |
| 106 | +**Purpose**: Customizes the header text in the release PR description. |
| 107 | + |
| 108 | +**Behavior**: |
| 109 | +- Appears at the top of the release PR body |
| 110 | +- Can include emojis and markdown |
| 111 | +- Provides context to reviewers |
| 112 | + |
| 113 | +**Documentation**: [Pull Request Header](https://github.com/googleapis/release-please?tab=readme-ov-file#pull-request-header) |
| 114 | + |
| 115 | +--- |
| 116 | + |
| 117 | +### Prerelease Configuration |
| 118 | + |
| 119 | +```json |
| 120 | +"prerelease": true, |
| 121 | +"prerelease-type": "alpha", |
| 122 | +"release-as": "5.0.0-alpha.0" |
| 123 | +``` |
| 124 | + |
| 125 | +**Purpose**: Configures prerelease versioning for alpha/beta releases. |
| 126 | + |
| 127 | +**`prerelease`**: |
| 128 | +- Enables prerelease mode |
| 129 | +- Affects version bumping logic |
| 130 | +- [Documentation](https://github.com/googleapis/release-please?tab=readme-ov-file#prerelease) |
| 131 | + |
| 132 | +**`prerelease-type`**: |
| 133 | +- Defines the prerelease identifier (alpha, beta, rc, etc.) |
| 134 | +- Appended to version: `5.0.0-alpha.0`, `5.0.0-alpha.1`, etc. |
| 135 | +- [Documentation](https://github.com/googleapis/release-please?tab=readme-ov-file#prerelease-type) |
| 136 | + |
| 137 | +**`release-as`**: |
| 138 | +- Forces the next release version |
| 139 | +- Used for major version bumps or initial releases |
| 140 | +- Takes precedence over conventional commit version bumps |
| 141 | +- [Documentation](https://github.com/googleapis/release-please?tab=readme-ov-file#release-as) |
| 142 | + |
| 143 | +--- |
| 144 | + |
| 145 | +### Packages |
| 146 | + |
| 147 | +```json |
| 148 | +"packages": { |
| 149 | + "packages/logger": { |
| 150 | + "component": "logger" |
| 151 | + }, |
| 152 | + "packages/cli": { |
| 153 | + "component": "cli", |
| 154 | + "extra-files": ["npm-shrinkwrap.json"] |
| 155 | + } |
| 156 | +} |
| 157 | +``` |
| 158 | + |
| 159 | +**Purpose**: Defines which packages in the monorepo should be managed by Release Please. |
| 160 | + |
| 161 | +**Structure**: |
| 162 | +- **Key**: Path to package directory (relative to repo root) |
| 163 | +- **`component`**: Name used in changelog and release notes. Avoid scopes (@ui5) as it might tag something wrongly on GitHub |
| 164 | +- **`extra-files`**: Additional files to version bump (beyond `package.json`) |
| 165 | + |
| 166 | +**Behavior**: |
| 167 | +- Each package gets its own changelog |
| 168 | +- Only specified packages are included in releases |
| 169 | + |
| 170 | +**Documentation**: [Monorepo Support](https://github.com/googleapis/release-please?tab=readme-ov-file#monorepo-support) |
| 171 | + |
| 172 | +**Note**: We explicitly configure packages instead of using `exclude-paths` because: |
| 173 | +1. More maintainable - clear list of released packages |
| 174 | +2. Prevents accidental inclusion of internal tooling |
| 175 | +3. Better for documentation and understanding |
| 176 | + |
| 177 | +--- |
| 178 | + |
| 179 | +### Plugins |
| 180 | + |
| 181 | +```json |
| 182 | +"plugins": [ |
| 183 | + { |
| 184 | + "type": "node-workspace", |
| 185 | + "merge": false |
| 186 | + }, |
| 187 | + { |
| 188 | + "type": "linked-versions", |
| 189 | + "groupName": "ui5-cli-packages", |
| 190 | + "components": ["logger", "fs", "builder", "server", "project", "cli"] |
| 191 | + } |
| 192 | +] |
| 193 | +``` |
| 194 | + |
| 195 | +**Purpose**: Extend Release Please functionality with additional behaviors. |
| 196 | + |
| 197 | +#### Node Workspace Plugin |
| 198 | + |
| 199 | +```json |
| 200 | +{ |
| 201 | + "type": "node-workspace", |
| 202 | + "merge": false |
| 203 | +} |
| 204 | +``` |
| 205 | + |
| 206 | +**Purpose**: Automatically updates workspace dependency versions in `package.json` files. |
| 207 | + |
| 208 | +**Behavior**: |
| 209 | +- Scans all `package.json` files in the workspace |
| 210 | +- Updates `dependencies` and `devDependencies` when workspace packages are bumped |
| 211 | +- `merge: false` means it updates versions but doesn't merge PRs automatically |
| 212 | + |
| 213 | +**Known Limitations**: |
| 214 | +- Cannot resolve circular peer dependencies (e.g., `@ui5/project` ↔ `@ui5/builder`) |
| 215 | +- May update lockfile entries for npm aliases incorrectly |
| 216 | + |
| 217 | +**Workaround**: We manually update circular peer dependencies in the workflow after Release Please runs. |
| 218 | + |
| 219 | +**Documentation**: [Node Workspace Plugin](https://github.com/googleapis/release-please/blob/main/docs/plugins.md#node-workspace) |
| 220 | + |
| 221 | +--- |
| 222 | + |
| 223 | +#### Linked Versions Plugin |
| 224 | + |
| 225 | +```json |
| 226 | +{ |
| 227 | + "type": "linked-versions", |
| 228 | + "groupName": "ui5-cli-packages", |
| 229 | + "components": ["logger", "fs", "builder", "server", "project", "cli"] |
| 230 | +} |
| 231 | +``` |
| 232 | + |
| 233 | +**Purpose**: Synchronizes version numbers across multiple packages in a monorepo. |
| 234 | + |
| 235 | +**Behavior**: |
| 236 | +- All specified components get the same version number |
| 237 | +- Single release PR for all packages |
| 238 | +- Single GitHub release created for the group |
| 239 | +- Changelogs are still separate per package |
| 240 | + |
| 241 | +**Benefits**: |
| 242 | +- Simplifies versioning for tightly coupled packages |
| 243 | +- Easier for consumers to know compatible versions |
| 244 | +- Reduces release management overhead |
| 245 | + |
| 246 | +**Documentation**: [Linked Versions Plugin](https://github.com/googleapis/release-please/blob/main/docs/plugins.md#linked-versions) |
| 247 | + |
| 248 | +--- |
| 249 | + |
| 250 | +### Changelog Sections |
| 251 | + |
| 252 | +```json |
| 253 | +"changelog-sections": [ |
| 254 | + { |
| 255 | + "type": "feat", |
| 256 | + "section": "Features" |
| 257 | + }, |
| 258 | + { |
| 259 | + "type": "fix", |
| 260 | + "section": "Bug Fixes" |
| 261 | + }, |
| 262 | + { |
| 263 | + "type": "docs", |
| 264 | + "section": "Documentation", |
| 265 | + "hidden": true |
| 266 | + } |
| 267 | +] |
| 268 | +``` |
| 269 | + |
| 270 | +**Purpose**: Defines which commit types appear in the changelog and how they're grouped. |
| 271 | + |
| 272 | +**Structure**: |
| 273 | +- **`type`**: Conventional commit type (feat, fix, docs, etc.) |
| 274 | +- **`section`**: Heading in the changelog |
| 275 | +- **`hidden`**: If `true`, commits won't appear in changelog but may still trigger version bumps |
| 276 | + |
| 277 | +**Behavior**: |
| 278 | +- Only configured types are included |
| 279 | +- Types can be reordered by array position |
| 280 | +- Hidden types are useful for internal changes (tests, CI, etc.) |
| 281 | + |
| 282 | +**Documentation**: [Changelog Sections](https://github.com/googleapis/release-please?tab=readme-ov-file#changelog-sections) |
| 283 | + |
| 284 | +**Our Configuration**: |
| 285 | +- **Visible**: Features, Bug Fixes, Performance Improvements, Dependencies, Reverts |
| 286 | +- **Hidden**: Documentation, Styles, Refactoring, Tests, Build, CI, Release |
0 commit comments