|
| 1 | +# Releasing |
| 2 | + |
| 3 | +Releases in this repository are managed with release-please. |
| 4 | + |
| 5 | +## Overview |
| 6 | + |
| 7 | +`release-please` has a two-phase process: |
| 8 | + |
| 9 | +1. **Phase 1**: It looks for conventional commits. When it detects a *releasable unit*, it creates or updates a release PR with version updates and release notes. |
| 10 | +2. **Phase 2**: When that PR is merged, `release-please` creates tags, labels, releases, etc. This also triggers custom steps like publishing packages and documentation. |
| 11 | + |
| 12 | +--- |
| 13 | + |
| 14 | +## What is a Releasable Unit? |
| 15 | + |
| 16 | +Using semver: |
| 17 | +- **Breaking changes** → bump major version |
| 18 | +- **New features (backward compatible)** → bump minor version |
| 19 | +- **Bug fixes (backward compatible)** → bump patch version |
| 20 | + |
| 21 | +> Not all changes require a new release (e.g. updating a build script). |
| 22 | +
|
| 23 | +A commit that starts with `chore:` is not a releasable unit. If only non-releasable commits are present, no release is created. |
| 24 | + |
| 25 | +--- |
| 26 | + |
| 27 | +## Conventional Commit Tags |
| 28 | + |
| 29 | +### Releasable |
| 30 | + |
| 31 | +| Tag | Version Change | Description | |
| 32 | +|---------|---------------------------|----------------------------------------------| |
| 33 | +| `fix:` | `1.0.0 → 1.0.1` | Backward compatible bug fix | |
| 34 | +| `feat:` | `1.0.0 → 1.1.0` | New feature (backward compatible), deprecations | |
| 35 | +| `feat!` | `1.0.0 → 2.0.0` | Breaking feature addition | |
| 36 | +| `fix!` | `1.0.0 → 2.0.0` | Breaking bug fix | |
| 37 | + |
| 38 | +### Non-releasable |
| 39 | + |
| 40 | +| Tag | Description | |
| 41 | +|-----------|--------------------------------------------------------| |
| 42 | +| `chore:` | General non-releasable changes | |
| 43 | +| `ci:` | CI configuration changes | |
| 44 | +| `docs:` | Documentation updates | |
| 45 | +| `style:` | Code formatting changes | |
| 46 | +| `refactor:` | Code refactors (can be releasable depending on context) | |
| 47 | +| `test:` | Test updates | |
| 48 | + |
| 49 | +--- |
| 50 | + |
| 51 | +## Corrections |
| 52 | + |
| 53 | +You can override a commit message by editing the PR description **before or after it’s merged**: |
| 54 | + |
| 55 | +``` |
| 56 | +BEGIN_COMMIT_OVERRIDE |
| 57 | +fix: This is my new message and conventional commit tag! |
| 58 | +END_COMMIT_OVERRIDE |
| 59 | +``` |
| 60 | + |
| 61 | +If post-merge, then the release-please workflow will need re-ran. Re-running the workflow will update the release PR. |
| 62 | + |
| 63 | +--- |
| 64 | + |
| 65 | +## Release Affecting a Shared Package |
| 66 | + |
| 67 | +This repo cannot automatically update inter-package dependencies and release those packages. Instead each package must be released in dependency order while making sure to update inter-package dependencies between releases. |
| 68 | + |
| 69 | +For example imagine that the `launchdarkly_dart_common` is currently at version `1.5.0`. |
| 70 | + |
| 71 | +If we merge a PR `feat: Add the new thing` which only affects files in `packages/common`, then release-please will determine it needs to release `1.6.0`. Release please will create a release PR and when we merge that release PR it will release `1.6.0` of `launchdarkly_dart_common`. |
| 72 | + |
| 73 | +No end-user is going to receive this package when they install `launchdarkly_flutter_client_sdk`, because that will be pinned to a specific version of `launchdarkly_common_client` which uses a pinned version of `launchdarkly_dart_common`. |
| 74 | + |
| 75 | +So we need to first edit the pubspec of `launchdarkly_common_client` to use `launchdarkly_dart_common` version `1.6.0`. |
| 76 | + |
| 77 | +In order to do this we would create and merge a new PR titles `feat: Update launchdarkly_dart_common to version 1.6.0`. |
| 78 | + |
| 79 | +We would merge that PR, then release `launchdarkly_common_client`. We continue to do this until all affected packages are released. |
| 80 | + |
| 81 | +### PR Affecting Multiple Packages |
| 82 | + |
| 83 | +If a single PR affects multiple packages, then the individual packages still must be released in dependency order updating affected versions between releases. |
| 84 | + |
| 85 | +For example imagine that the `launchdarkly_dart_common` is currently at version `1.5.0`, `launchdarkly_client_common` is version `1.6.0` and `launchdarkly_flutter_client_sdk` is `4.10.0`. |
| 86 | + |
| 87 | +If we merge a PR `feat: Add the new thing` which affects files in `packages/common` and `packages/flutter_client_sdk`, then release-please will determine it needs to release `1.6.0` of `launchdarkly_dart_common` and `4.11.0` of `launchdarkly_flutter_client_sdk`. Release please is going to create release PRs for *BOTH* of these packages. |
| 88 | + |
| 89 | +In order to fully release this update we actually will need to release `launchdarkly_dart_common`, `launchdarkly_common_client`, and `launchdarkly_flutter_client_sdk`. |
| 90 | + |
| 91 | +What we would do is this: |
| 92 | +- Merge the release PR for `launchdarkly_dart_common`. |
| 93 | +- Create and then merge a new PR for `launchdarkly_common_client` which updates it to use `1.6.0` of `launchdarkly_dart_common`. This will generate a new release PR for `launchdarkly_common_client` version `1.7.0` |
| 94 | +- Merge the release PR for `launchdarkly_common_client`. |
| 95 | +- Create and then merge a new PR for `launchdarkly_flutter_client_sdk` which updates it to use `1.7.0` of `launchdarkly_dart_common`. This will update the release PR for `launchdarkly_common_client` version `4.11.0` |
| 96 | +- Merge the release PR for `launchdarkly_flutter_client_sdk`. |
0 commit comments