Skip to content

Latest commit

 

History

History
79 lines (64 loc) · 4.65 KB

PUBLISHING.md

File metadata and controls

79 lines (64 loc) · 4.65 KB

PUBLISHING

A reference guide on how to do releases of the VF monorepo's tools and components.

Notes

Prerequisites

  • Have installed Lerna globally
  • Installed dependencies in /tools/vf-core/ with yarn install
  • Installed dependencies in root folder with yarn install
  • Have logged in to a npm account belonging to the visual-framework organization

Release workflow

1. Component pre-release

  1. select the develop branch
  2. see a list of changed packages
    • lerna changed
  3. ensure all packages to be released have ready an updated changelog and to which version are going to be bumped
    • verify the new versions of each package doesn't exist on npm
  4. test publish
    • yarn run lerna:test

2. Component release

  1. publish to npm
    • yarn run lerna:publish
    • lerna will prompt the versions of all packages twice
      • 1st one to publish the packages to npm. Please enter the code for npm from your authenticator app as that's a requirement now for 2 factor authentication.
      • 2nd one to update package.json files of all packages published
  2. In case there's a need to release a package prior to a full library release, do the following:
    • Make sure the package code is updated and along with the respective CHANGELOG.md file and works well with rest of the code. Also make sure package.json is updated with the newer version you're going to push to npm. npm version patch command can be used for updating the package.json in case you're doing a patch release.
    • Commit this package code to develop branch and checkout this branch on your local. Again make sure the complete code works well with latest packages and there are no discrepancies.
    • Make sure you're logged in to a npm account belonging to the visual-framework organization.
    • In a terminal window, go to the package folder and then run npm publish --dry-run. This will do a dry run of the publish command and show if there's any error before publishing.
    • If satisfied with dry run then do npm publish. It might ask you for code for npm from authenticator app for 2 factor authentication as mentioned above. Once the package is published to npm you'll get the confirmation in the window.
    • When you're doing a full release make sure that the package changes are accounted for in the rollup release blog.

3. Communications

  1. update the expected new tag version to /tools/vf-component-library/src/site/_data/siteConfig.js
    • see last tag git describe --abbrev=0 --tags
  2. Remove dev from vfVersionPrefix in /tools/vf-component-library/src/site/_data/siteConfig.js, this is needed only for development
  3. generate an update
    • yarn run releasenotes
    • format and review the newly made file at tools/vf-component-library/src/site/updates
      • copy structure from previous release notes
      • for each component, put latest changelog updates and link it with releaseLinks.notes

4. Post-release

  1. commit and push changes to the develop branch
    • commit message in a format of: Component release 20211130-01
  2. add a tag
    • see last tag git describe --abbrev=0 --tags
    • add a semantic versioned tag git tag -a v2.5.2-beta.5 -m 'Release of precompiled CSS, JS, assets'
    • Why like this?
      • We do not add tags per individual component version. However, Lerna needs a named tag to see what has changed. With our method we get one tag per release bundle and avoid tag spamming in the release history.
      • Trigger a deploy to the CDN (i.e. v2.5.0) https://assets.emblstatic.net/vf/v2.4.10/css/styles.css
  3. push the tag
    • git push origin --tags
  4. add release notes to the tag and link to the new blog post
  5. Add dev to vfVersionPrefix in /tools/vf-component-library/src/site/_data/siteConfig.js, this is needed only for development. Push this change to develop branch.

Appendix of useful Lerna commands

  • lerna ls list all packages known to lerna
  • lerna ls --since af04cb2a list all changed packages since a commit (sadly not combinable with lerna publish)
  • lerna diff all changes since last publish
  • lerna changed all packages changed