A basic Lerna monorepo with Yarn Workspaces, Conventional Commits and GitHub Actions workflow configuration to achieve fully automated package publishing to the NPM registry. As a bonus Renovate bot keeps dependencies up to date.
Click the Use this template
button and provide the new repository details.
Let's start by setting up the new repository:
-
To perform authenticated operations against the npm registry in your workflow, you'll need to store your npm authentication token as a secret
NPM_TOKEN
. For more information, see "Creating and using encrypted secrets." (source) -
Update the root
package.json
with your repository name and url. -
Modify the sample packages as needed and remember to update their
package.json
. -
Run
yarn
to bootstrap the packages. This will install all of their dependencies and links any cross-dependencies.
Each push to main
branch will generate a version number, git tag, Conventional Changelog, release commit, pushing changes to the origin and publish to the NPM registry.