Skip to content

Release Automation

Marwan Zogheib edited this page Apr 20, 2024 · 4 revisions

Ideal condition

  1. New releases are automated, i.e. no human involvement to bump semver, add git tags etc.
  2. Packages are automatically published and dependencies automatically updated.
  3. Changelogs are automatically generated.

High Level Solution

  • Use a consistent commit language that can be parsed by various tools, e.g. conventional commits
    • This should be strictly enforced on the releasing branch (master)
  • lerna publish --conventional-commits could then be used to consume all of the commit messages to automatically bump versions, publish packages and generate changelogs.

Other considerations

  • Use husky to lint commit messages
  • Use GitHub apps to enforce PR titles and commit messages
  • Could potentially release on every commit to master

Publishing via GitHub Actions

  • A workflow can be manually run to run the learn publish command
  • For the lerna publish command to work correctly it needs access to historical commits and tags.
  • But as described here actions/checkout only checks out the last commit by default. In the absence of tags lerna assumes all packages have changed.
  • It's impossible to know how many commits back the last tags were. So the solution is to checkout all commits and tags.

References