Skip to content

Commit

Permalink
chore: Update instructions for releaseing to NPM with Lerna (#335)
Browse files Browse the repository at this point in the history
  • Loading branch information
macdiesel authored Jul 20, 2023
1 parent 6450cca commit fe8714c
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 3 deletions.
12 changes: 10 additions & 2 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -113,9 +113,17 @@ Versioning and releases

This library has its version automatically updated by Lerna (i.e., ``lerna version``) using semantic-versioning under-the-hood when the release is published to npm. Lerna is configured to use independent versioning with conventional commits, as opposed to keeping all package versions in sync.

When a PR is merged, Lerna creates a release commit (e.g., ``chore(release): publish``). In this commit, Lerna increments the versions in the appropriate package.json files for any changed packages, creates Git tags, and updates the CHANGELOG file.
When a PR is merged, you must manually run Lerna to create a release commit (e.g., ``chore(release): publish``). In this commit, Lerna increments the versions in the appropriate package.json files for any changed packages, creates Git tags, and updates the CHANGELOG file.
To create this commit:
::

npm run lerna:version
git push --set-upstream origin automation/lerna/version
git push —-tags

Once you have pushed the release commit and tag, you create a new PR from your branch ``automation/lerna/version`` in this example. Once the PR is open review and merge.

To publish the packages that had their versions incremented, you must manually trigger the ``Publish from package.json`` Github Action workflow `found here <https://github.com/openedx/frontend-enterprise/actions/workflows/publish-from-package.yml>`_. It will publish any versions denoted in the package.json files that are not currently published on the NPM registry, publishing the incremented versions from the aforementioned release commit.
To publish the packages that had their versions incremented per above, you must manually trigger the ``Publish from package.json`` Github Action workflow `found here <https://github.com/openedx/frontend-enterprise/actions/workflows/publish-from-package.yml>`_. It will publish any versions denoted in the package.json files that are not currently published on the NPM registry, publishing the incremented versions from the aforementioned release commit.

Preview changed packages in CI with Github Actions
-----
Expand Down
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@
"lint": "npm run lint --workspaces",
"lint:fix": "npm run lint:fix --workspaces",
"bootstrap": "npm install conventional-changelog-conventionalcommits",
"changed": "lerna changed"
"changed": "lerna changed",
"lerna:version": "npx lerna@6 version --conventional-commits --create-release github --no-push"
},
"devDependencies": {
"@commitlint/config-conventional": "17.6.0",
Expand Down

0 comments on commit fe8714c

Please sign in to comment.