-
Notifications
You must be signed in to change notification settings - Fork 6
Publish Release on NPM
Stop all yarn start or yarn serve commands.
To release the latest code, you'll need the latest code ✅😅.
$ git checkout master
$ git pullTo ensure a clean release, you'll want to make sure that generated assets are created as cleanly as possible.
- The
npm publishcommand will package up everything indist/and publish to NPM.
# Clean up generated files
$ rm -rf distDevelopment dependencies should be reinstalled to minimize the chances for unexpected errors.
$ yarn install:cleanThe npm get registry command should respond with the public NPM registry (https://registry.npmjs.org/ at the time of writing this document).
$ npm get registry
https://registry.npmjs.org/This should be handled by the project .npmrc configuration, but different versions of the npm command may respond differently.
The npm whoami command should respond with "helix-ui".
$ npm whoami
helix-uiIf npm whoami returns a different value or no value, STOP!
Ask a HelixUI dev for help, before you continue.
Given that the release tasks will update package.json, we want to make sure we stick to a feature branch workflow so that we can merge the version changes back into master.
The name of this branch doesn't matter, but it does need to be based off master.
A good naming convention to follow is release-{VERSION} (e.g., release-Helix-React-v1.3.0-alpha)
$ git checkout -t -b release-{VERSION}Since we are currently in alpha, we do not have an automated build pipeline. So, the following manual step MUST completed before publishing the release on NPM.
$ yarn buildnpm already has logic built-in to bump the version number.
Run npm help version for more information.
WARNING: npm currently does not have a dry run option. Start with premajor, preminor, or prepatch to make sure everything is running smoothly before you publish.
npm version (major | minor | patch | premajor | preminor | prepatch | prerelease)Say we're currently at 0.0.1 of Helix-React.
npm version prepatch # 0.0.2-rc.0
npm version prerelease # 0.0.2-rc.1
npm version patch # 0.0.2
npm version preminor # 0.1.0-rc.0
npm version prerelease # 0.1.0-rc.1
npm version minor # 0.1.0
npm version premajor # 1.0.0-rc.0
npm version prerelease # 1.0.0-rc.1
npm version major # 1.0.0NOTE: This step requires npm whoami to be set up correctly.
To publish new assets to NPM, just run:
npm publishCheck the version displayed for the helix-react package on npmjs.com.
Check the output of:
npm view @helix-design-system/helix-react version versionsBecause npm version uses and modifies package.json, you'll need to merge changes back into master so that future releases will start with the correct version.
- Push your branch to github
- Submit a PR against the
masterbranch - Merge the PR
- Delete version branch