This is an example of monorepo release flow.
This monorepo use yarn + lerna + changesets + GitHub Actions.
Related:
- atlassian/changesets: 🦋 A way to manage your versioning and changelogs with a focus on monorepos
- azu/pr-to-changesets: Create changesets content from Pull Request.
Another monorepo release flow:
- azu/lerna-monorepo-github-actions-release: Lerna + monorepo +GitHub Actions Release Flow
- GitHub Actions + Lerna
- lernaでのmonorepoにおけるリリースフロー(Fixed/Independent) | Web Scratch
- Lerna manually
- User can control packages versions
- Draft changelog before publishing - integrate with changesets
- GitHub PR's Label Based version control - use pr-to-changesets
- Publish tag and packages from CI
- Support independent mode
- [Person] Develop and Submit Pull Request
- [Team] Review Pull Request and attach Version Label
- [CI] Create Release Pull Request
- [Team] Merge Release Pull Request
- [CI] Publish
- [Local] Checkout branch:
git checkout release/<uniq>
- [Local] Submit to Pull Request
- [GitHub] Review Pull Request and attach a label one of
Semver: {major, minor, patch}
- [GitHub] Merge Pull Request
- [CI] pr-to-changesets create
.changeset/*.md
from Pull Request- The changed packages in the Pull Request, add it as
Semver: <version>
into.changesets
's log - It means that each version are controlled by the label of Pull Request.
- It work with Lerna's Independent mode.
- Fore more details, see pr-to-changesets and changesets
- Implementation in .github/workflows/pr-to-changesets.yml
- The changed packages in the Pull Request, add it as
- [CI] Submit Version up Pull Request
- When another pull request is merged, Update the Version up Pull Request
- Implementation in .github/workflows/publish.yml
- [GitHub] Review Version up Pull Request and Merge Pull Request
- [CI] Release to npm
- Each packages are published as
Semver: <version>
- Implementation in [.github/workflows/publish.yml](.github/workflows/publish.yml
- Each packages are published as
- [Person] Submit Pull Request: fix(packages): add test by azu · Pull Request #1 · azu/monorepo-release-changesets
- [Team or Person] add Label for versioning
-
[CI] Create Version up Pull Request: Version Packages by github-actions · Pull Request #5 · azu/monorepo-release-changesets
-
[Team] Review it and Merge It
-
[CI] Publish update packages to npm registry
GitHub Label like Semver: patch
is user defined label.
It means that you can use another labels like Type: Feature
and Type: BREAKING CHANGE
.
- Semver Labels is defined in .github/pr-to-changesets.json.
- If you want to check required label, you can use these bot
- fossapps/pr_label_enforcer: https://github.com/marketplace/pr-label-enforcer
- sugarshin/required-labels-action: A GitHub Actions that automated label checking for pull requests
- This repository use [pr_label_enforcer) and define the labels in .github/pr_labels.yml
See Releases page.
Install devDependencies and Run npm test
:
npm test
Pull requests and stars are always welcome.
For bugs and feature requests, please create an issue.
- Fork it!
- Create your feature branch:
git checkout -b my-new-feature
- Commit your changes:
git commit -am 'Add some feature'
- Push to the branch:
git push origin my-new-feature
- Submit a pull request :D
MIT © azu