Skip to content

Release Version & Publish

Benjamin Perez edited this page Jul 26, 2024 · 2 revisions

Description

Versioning and publishing are automated via Github Actions.

Pre-Release on develop

To release any packages from a squad branch, please do as follow:

  • rebase your branch with develop
  • then, better to create a new PR to merge your branch into develop
  • if not, you can merge manually

Release on main

Once the developments have been validated on recette-release, you can make a PR to merge the develop branch into the main branch.

Version & Publish

But for some reasons, if a package is not versioned or released correctly, it is possible to do it manually

Prerequisite

  • NPM_TOKEN must be configured in one of this file: zshrc, bashrc, ...
  • The Git Workspace tree should be clean!

Version

You can follow this link

  • npx lerna version --no-private --force-publish
lerna notice cli v5.1.2
lerna info current version 1.0.0
lerna info Assuming all packages changed
? Select a new version (currently 1.0.0) (Use arrow keys)
❯ Patch (1.0.1)
  Minor (1.1.0)
  Major (2.0.0)
  Prepatch (1.0.1-alpha.0)
  Preminor (1.1.0-alpha.0)
  Premajor (2.0.0-alpha.0)
  Custom Prerelease
  Custom Version
  • Select Custom Prerelease
lerna notice cli v8.0.1
lerna info current version 1.5.4-develop.2
lerna info Assuming all packages changed
? Select a new version (currently 1.0.0) (Use arrow keys)
? Enter a prerelease identifier (default: "develop", yielding 1.5.4-develop.3)
  • Enter

Lerna will version, add, commit and push changes with this commit message: chore(release): version & publish

Publish

  • npx lerna publish from-git --conventional-commits --preid BRANCH --pre-dist-tag BRANCH --force-publish
  • Replace BRANCH with the current targeted branch (develop, develop-[squad])
lerna notice cli v8.0.1

Found 5 packages to publish:
 - edifice-bootstrap => 1.5.4-develop.3
 - edifice-ts-client => 1.5.4-develop.3
 - @edifice-ui/editor => 1.5.4-develop.3
 - @edifice-ui/icons => 1.5.4-develop.3
 - @edifice-ui/react => 1.5.4-develop.3

? Are you sure you want to publish these packages? (ynH)
  • If your NPM_TOKEN is configured correctly, Lerna will publish each package to NPM
  • If not, use export NPM_TOKEN= with the token inside your terminal, and do it again.

⚠️ If something goes wrong, you will have to checkout all package.json files

  • git checkout packages

Then, retry the process to publish packages.

Clone this wiki locally