|
| 1 | +# Release Runbook |
| 2 | + |
| 3 | +## Overview |
| 4 | + |
| 5 | +This monorepo contains multiple packages that are versioned and released independently. |
| 6 | +A release is prepared as a single PR with one commit per bumped package, followed by an "Update files" commit. |
| 7 | + |
| 8 | +## Packages (publish order) |
| 9 | + |
| 10 | +Packages must be published in dependency order (core first, enhanced last): |
| 11 | + |
| 12 | +1. `packages/core` — `flutter_widget_from_html_core` |
| 13 | +2. `packages/fwfh_cached_network_image` |
| 14 | +3. `packages/fwfh_chewie` |
| 15 | +4. `packages/fwfh_just_audio` |
| 16 | +5. `packages/fwfh_svg` |
| 17 | +6. `packages/fwfh_url_launcher` |
| 18 | +7. `packages/fwfh_webview` |
| 19 | +8. `packages/enhanced` — `flutter_widget_from_html` |
| 20 | + |
| 21 | +## Step 1: Identify what changed |
| 22 | + |
| 23 | +Find the most recent release tag: |
| 24 | + |
| 25 | +```sh |
| 26 | +git tag --sort=-creatordate | head -5 |
| 27 | +``` |
| 28 | + |
| 29 | +For each package, check for changes since that tag: |
| 30 | + |
| 31 | +```sh |
| 32 | +git log <tag>..origin/master --oneline -- packages/<package>/ |
| 33 | +``` |
| 34 | + |
| 35 | +Skip docs-only and formatting-only commits (they don't affect the published package). |
| 36 | + |
| 37 | +## Step 2: Create the release branch |
| 38 | + |
| 39 | +```sh |
| 40 | +git checkout -b prepare/v<version> origin/master |
| 41 | +``` |
| 42 | + |
| 43 | +The branch name uses the enhanced package version (the "main" package). |
| 44 | + |
| 45 | +## Step 3: Bump each changed package |
| 46 | + |
| 47 | +Create **one commit per package**, in dependency order. Each commit includes: |
| 48 | + |
| 49 | +| File | Change | |
| 50 | +| -------------------------------- | -------------------------------------------- | |
| 51 | +| `packages/<pkg>/pubspec.yaml` | Bump `version:` | |
| 52 | +| `packages/<pkg>/CHANGELOG.md` | Add new version section at the top | |
| 53 | +| `packages/<pkg>/README.md` | Update version in the `pubspec.yaml` snippet | |
| 54 | +| `packages/enhanced/pubspec.yaml` | Bump dependency constraint for the package | |
| 55 | + |
| 56 | +### Commit message format |
| 57 | + |
| 58 | +``` |
| 59 | +[<package_short_name>] v<version> |
| 60 | +``` |
| 61 | + |
| 62 | +Examples: `[core] v0.17.2`, `[fwfh_webview] v0.15.7`, `[enhanced] v0.17.2` |
| 63 | + |
| 64 | +### Changelog conventions |
| 65 | + |
| 66 | +- List features first, then fixes |
| 67 | +- Reference PR/issue numbers: `(#1234)` |
| 68 | +- Credit external contributors: `(#1234, authored by @username)` |
| 69 | +- Do not include docs-only or formatting-only changes |
| 70 | + |
| 71 | +Example: |
| 72 | + |
| 73 | +```markdown |
| 74 | +## 0.17.2 |
| 75 | + |
| 76 | +- Add `text-emphasis` / `text-emphasis-style` support (#1561, authored by @CaptainDario) |
| 77 | +- Fix border-radius with background-color for inline elements (#1569) |
| 78 | +``` |
| 79 | + |
| 80 | +### Dependency constraints |
| 81 | + |
| 82 | +When bumping a package, update the `^` constraint in downstream packages even if the old |
| 83 | +constraint technically covers the new version. For example, if core goes from `0.17.1` to |
| 84 | +`0.17.2`, update enhanced's `flutter_widget_from_html_core: ^0.17.1` to `^0.17.2`. |
| 85 | + |
| 86 | +## Step 4: Update demo app files |
| 87 | + |
| 88 | +```sh |
| 89 | +./tool/update-demo_app-files.sh |
| 90 | +``` |
| 91 | + |
| 92 | +This recreates the demo app's platform files and pubspec.lock. Commit the result: |
| 93 | + |
| 94 | +``` |
| 95 | +Update files |
| 96 | +``` |
| 97 | + |
| 98 | +## Step 5: Publish to pub.dev |
| 99 | + |
| 100 | +Publish **before** pushing the PR. Some backward compatibility CI checks depend on |
| 101 | +the new versions being available on pub.dev. |
| 102 | + |
| 103 | +Requires `yq` (`brew install yq`). |
| 104 | + |
| 105 | +```sh |
| 106 | +./tool/pub-publish.sh |
| 107 | +``` |
| 108 | + |
| 109 | +This script: |
| 110 | + |
| 111 | +1. Checks each package for uncommitted changes |
| 112 | +2. Skips packages whose version already exists on pub.dev |
| 113 | +3. Removes `dependency_overrides`, runs `flutter pub get` and tests |
| 114 | +4. Publishes via `flutter pub publish` |
| 115 | +5. Reverts local changes after publishing |
| 116 | + |
| 117 | +Packages are published in dependency order (core first, enhanced last). |
| 118 | + |
| 119 | +## Step 6: Create the PR |
| 120 | + |
| 121 | +```sh |
| 122 | +git push -u origin prepare/v<version> |
| 123 | +gh pr create --title "Prepare v<version> releases" --body "" |
| 124 | +``` |
| 125 | + |
| 126 | +Previous release PRs have empty bodies. The per-commit messages are sufficient. |
| 127 | + |
| 128 | +## Step 7: Merge and tag |
| 129 | + |
| 130 | +After CI passes, merge the PR. Then tag: |
| 131 | + |
| 132 | +```sh |
| 133 | +git tag v<version> |
| 134 | +git push origin v<version> |
| 135 | +``` |
0 commit comments