Prerequisites:
- You have an npmjs.com account (recommended to use your personal; not work email for this)
- You have two factor authentication (2FA) turned on for your npm account. See additional steps
- You have Administrator access to this repo on GitHub (you are able to push commits)
- You have Permissions to publish to the influxdata organization on npm
- contact Bucky to be added if needed (if you just created an npm account, you need this)
- anybody with an admin permission can add through here: https://www.npmjs.com/settings/influxdata/teams/team/developers/users
- tags can only be created on the
master
branch, and the working tree must be clean- clean means: all the files in the current directory are being managed by git (or are being intentionally ignored via .gitignore) and the most recent version of the file has been committed
- Consider bumping the version in package.json when you create your feature. This way, the release page points to the code being released. To see an example, click the git hash on this giraffe release (not ideal) and then click the git hash on this giraffe release (ideal)
- If a new component is created, export it by adding the path of this new component in src/index.ts
Steps
-
run the publish script in the root of the repo and pass in the new version:
./publish 2.7.3
-
push up the new tag:
git push
-
update the changelog: Changelog file
- push it up after changing (can do a pr without an issue, if you already know your pr number this change can be included in the actual pr with the actual changes too)
-
update the release page on github: https://github.com/influxdata/clockface/releases
- ensure it is pointing at the correct release/commit
-
next; test it via e2e tests on the ui project; there should only be one pull request in each new version
- bump up the version number in package.json in the ui project
-
Optional:
Then upload the latest Storybook docs to the GitHub pages site by running:
yarn run publishStorybook
NOTE: Do not manually change the version in package.lock
, the publish script will increment automatically
To publish, you must have two factor authentication turned on for your npm account. For assistance setting this up, visit npm's official docs on this topic.
Additionally, npm recently updated the way they recognize 2FA during publishing. If you have not done so previously for any other libraries, you may need to set up a publishing token by doing the following. After these steps are taken, then you will be able to publish successfully using the steps outlined above
- Log in to npmjs.org
- Click on your image avatar in the corner
- Select Access Tokens
- Click on the button Generate New Token
- Name the token and select type: Publish
- Click Generate Token when ready
- Copy the token string - this is your only chance to copy this string
- Go to your project's local repository
- Create a .npmrc file (if necessary) at the root of the repository
- Append this line in the .npmrc file:
//registry.npmjs.org/:_authToken=<access_token>
- Replace <access_token> with the token string