|
| 1 | +# Automated Release Guide |
| 2 | + |
| 3 | +Guide for the automated release process in Equinor Design System using Release Please and GitHub Actions. |
| 4 | + |
| 5 | +## Table of Contents |
| 6 | + |
| 7 | +- [Prerequisites](#prerequisites) |
| 8 | +- [Quick Start](#quick-start) |
| 9 | +- [How It Works](#how-it-works) |
| 10 | +- [Understanding Release PRs](#understanding-release-prs) |
| 11 | +- [Manual Steps After Release](#manual-steps-after-release) |
| 12 | +- [GitHub Releases](#github-releases) |
| 13 | +- [Troubleshooting](#troubleshooting) |
| 14 | +- [Configuration](#configuration) |
| 15 | +- [Resources](#resources) |
| 16 | + |
| 17 | +## Quick Start |
| 18 | + |
| 19 | +1. **Use conventional commits** during development (see [CONVENTIONAL_COMMITS.md](./CONVENTIONAL_COMMITS.md)) |
| 20 | + - `feat(eds-core-react): add new button variant` β minor version bump |
| 21 | + - `fix(eds-icons): correct icon alignment` β patch version bump |
| 22 | + - `feat(eds-tokens)!: breaking change` β major version bump |
| 23 | + |
| 24 | +2. **Merge PR to `main`** β Release Please automatically creates/updates a release PR |
| 25 | + |
| 26 | +3. **Review the release PR**: |
| 27 | + - Check version bumps are appropriate |
| 28 | + - Verify CHANGELOG entries |
| 29 | + - Ensure all packages are included |
| 30 | + |
| 31 | +4. **Merge the release PR** β Automatic publishing begins |
| 32 | + |
| 33 | +5. **Verify publishing** - Check GitHub Actions workflows complete successfully |
| 34 | + |
| 35 | +6. **Update master branch** - Rebase `master` from `main` |
| 36 | + |
| 37 | +7. **Announce release** - Post in `#eds-design-system` Slack channel |
| 38 | + |
| 39 | +## How It Works |
| 40 | + |
| 41 | +### Automated |
| 42 | + |
| 43 | +- β
Version bumping |
| 44 | +- β
CHANGELOG generation |
| 45 | +- β
npm publishing |
| 46 | +- β
Git tag creation |
| 47 | +- β
GitHub releases |
| 48 | + |
| 49 | +### Manual |
| 50 | + |
| 51 | +- β οΈ Rebasing master |
| 52 | +- β οΈ Announcements |
| 53 | + |
| 54 | +## Understanding Release PRs |
| 55 | + |
| 56 | +When Release Please detects releasable changes, it creates a special PR with the title pattern "chore: release[component]". This PR contains: |
| 57 | + |
| 58 | +### What's Included |
| 59 | + |
| 60 | +- **Version bumps** in `package.json` files for affected packages |
| 61 | +- **Updated CHANGELOGs** with categorized commits (β¨ Added, π Fixed, etc.) |
| 62 | +- **Release summary** showing all packages being released in the PR description |
| 63 | + |
| 64 | +### How to Review |
| 65 | + |
| 66 | +1. **Check version bumps** - Ensure semantic versioning is correct (especially important if there's breaking changes) |
| 67 | +2. **Review CHANGELOGs** - Verify all important changes are captured |
| 68 | +3. **Validate scope** - Confirm all affected packages are included |
| 69 | +4. **Test if needed** - Run tests or verify builds if uncertain |
| 70 | + |
| 71 | +### When to Merge |
| 72 | + |
| 73 | +- β
All automated checks pass |
| 74 | +- β
Version bumps look correct |
| 75 | +- β
No breaking changes without proper version bump |
| 76 | +- β
Ready to publish to npm and announce |
| 77 | + |
| 78 | +### Important Notes |
| 79 | + |
| 80 | +- **One PR for all packages** - Don't expect separate PRs per package |
| 81 | +- **Accumulative** - PR updates automatically with new commits until merged |
| 82 | +- - **No manual editing** - Don't edit the PR content manually; it will be overwritten |
| 83 | + |
| 84 | +## Manual Steps After Release |
| 85 | + |
| 86 | +While most of the release process is automated, these steps still need to be done manually: |
| 87 | + |
| 88 | +### Update Master Branch |
| 89 | + |
| 90 | +- Switch to the `master` branch: |
| 91 | + |
| 92 | + ```bash |
| 93 | + git checkout master |
| 94 | + ``` |
| 95 | + |
| 96 | +- Rebase `master` with the latest changes from `main`: |
| 97 | + |
| 98 | + ```bash |
| 99 | + git rebase main |
| 100 | + ``` |
| 101 | + |
| 102 | +- Push the updates to the remote repository: |
| 103 | + |
| 104 | + ```bash |
| 105 | + git push |
| 106 | + ``` |
| 107 | + |
| 108 | +### Verify Release |
| 109 | + |
| 110 | +- Verify the new version is available on [npmjs](https://www.npmjs.com/package/@equinor/eds-core-react?activeTab=versions). |
| 111 | +- Verify the new [storybook](https://storybook.eds.equinor.com/) is published. |
| 112 | + |
| 113 | +### Announce Release |
| 114 | + |
| 115 | +- Announce the release in #eds-design-system Slack channel |
| 116 | +- Leave out any chores, CI/CD changes, build system updates, and other internal changes that are not relevant to end users |
| 117 | +- Focus on user-facing features, fixes, and breaking changes |
| 118 | + |
| 119 | +Here's a template for future release announcements: |
| 120 | + |
| 121 | +--- |
| 122 | + |
| 123 | +We've just released: |
| 124 | + |
| 125 | +- **[package-name-1] v[version-number-1]** |
| 126 | +- **[package-name-2] v[version-number-2]** |
| 127 | + |
| 128 | +### **[Package-Name-1]:** |
| 129 | + |
| 130 | +**Added** |
| 131 | + |
| 132 | +- β¨ [Feature-1]: [Short description of the feature] by @[author] |
| 133 | +- β¨ [Feature-2]: [Short description of the feature] by @[author] |
| 134 | + |
| 135 | +**Fixed** |
| 136 | + |
| 137 | +- π [Fix-1]: [Short description of the fix] by @[author] |
| 138 | +- π [Fix-2]: [Short description of the fix] by @[author] |
| 139 | + |
| 140 | +### **[Package-Name-2]:** |
| 141 | + |
| 142 | +**Added** |
| 143 | + |
| 144 | +- β¨ [Feature-1]: [Short description of the feature] by @[author] |
| 145 | + |
| 146 | +> Note: [Include any important dependency or compatibility notes here.] |
| 147 | +
|
| 148 | +--- |
| 149 | + |
| 150 | +**Best,** |
| 151 | +The EDS Core Team |
| 152 | + |
| 153 | +--- |
| 154 | + |
| 155 | +## GitHub Releases |
| 156 | + |
| 157 | +GitHub releases are now created automatically when the release PR is merged. The releases will include: |
| 158 | + |
| 159 | +- All commit types from the CHANGELOG (features, fixes, docs, etc.) |
| 160 | +- Proper version tags matching the npm packages |
| 161 | +- Release notes generated from conventional commits |
| 162 | + |
| 163 | +If you need to edit a release after it's created: |
| 164 | + |
| 165 | +1. Go to [GitHub Releases](https://github.com/equinor/design-system/releases) |
| 166 | +2. Find the release you want to edit |
| 167 | +3. Click "Edit release" |
| 168 | +4. Make necessary changes and save |
| 169 | + |
| 170 | +## Troubleshooting |
| 171 | + |
| 172 | +**No release PR created?** |
| 173 | + |
| 174 | +- Check commit format follows conventional commits |
| 175 | +- Verify commits on `main` with package scope |
| 176 | + |
| 177 | +**Wrong version bump?** |
| 178 | + |
| 179 | +- `feat!:` = major |
| 180 | +- `feat:` = minor |
| 181 | +- `fix:` = patch |
| 182 | + |
| 183 | +**Publishing failed?** |
| 184 | + |
| 185 | +- Check workflow logs in GitHub Actions |
| 186 | +- Re-run workflow or publish manually |
| 187 | + |
| 188 | +**Need to skip release?** |
| 189 | + |
| 190 | +- Leave PR open, merge later |
| 191 | + |
| 192 | +**Need to rollback a release?** |
| 193 | + |
| 194 | +If a release has critical issues: |
| 195 | + |
| 196 | +1. **Create hotfix immediately**: Make emergency fix and create new release (recommended approach) |
| 197 | +2. **Deprecate problematic version**: Use `npm deprecate @equinor/package@version "Critical issue - use version X.X.X instead"` |
| 198 | +3. **Communicate quickly**: Announce the issue and hotfix plan in #eds-design-system and affected channels |
| 199 | +4. **Document the incident**: Update release notes to mention the issue and resolution |
| 200 | + |
| 201 | +**Release PR disappeared or corrupted?** |
| 202 | + |
| 203 | +- Release Please recreates PRs automatically on next push to `main` |
| 204 | +- Don't try to manually recreate - let Release Please handle it |
| 205 | + |
| 206 | +## Configuration |
| 207 | + |
| 208 | +- [`.github/release-please-config.md`](../../.github/release-please-config.md) - Detailed config docs |
| 209 | +- [CONVENTIONAL_COMMITS.md](./CONVENTIONAL_COMMITS.md) - Commit guidelines |
| 210 | + |
| 211 | +## Resources |
| 212 | + |
| 213 | +- [Release Please Docs](https://github.com/googleapis/release-please) |
| 214 | +- [Semantic Versioning](https://semver.org/) |
0 commit comments