Skip to content

Commit

Permalink
docs(ci): add alternative .npmrc command and circle ci details (#764)
Browse files Browse the repository at this point in the history
  • Loading branch information
lipe-dev committed May 10, 2021
1 parent 239e640 commit cb3e255
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions docs/ci.md
Expand Up @@ -75,9 +75,12 @@ package:
One way to achieve this is to set the `NPM_TOKEN` in the CI environment, and from a script do:

```bash
echo "//registry.npmjs.org/:_authToken=$NPM_TOKEN" > .npmrc
npm config set //registry.npmjs.org/:_authToken $NPM_TOKEN
```

This will create/update the `.npmrc` file and add the token there. Ideally you should either `.gitignore` this file,
otherwise you might end up committing it to your repo if you are using release-it's `git` options.

Since release-it executes `npm whoami` as a [prerequisite check](./npm.md#prerequisite-checks), which does not seem to
respect the `.npmrc` file, the `--npm.skipChecks` argument can be used.

Expand Down Expand Up @@ -107,9 +110,13 @@ jobs:
at: ~/repo
- run:
name: Authenticate with registry
command: echo "//registry.npmjs.org/:_authToken=$NPM_TOKEN" > ~/repo/.npmrc
command: npm config set //registry.npmjs.org/:_authToken $NPM_TOKEN
```

During the release process, your project's `package.json` will be updated to bump the version. You will need to setup
CircleCI with a non read-only SSH key pair from your Github account if you want it to be able to push that change back
to the repo.

See [Publishing npm Packages Using CircleCI](https://circleci.com/blog/publishing-npm-packages-using-circleci-2-0/) for
more details.

Expand Down

0 comments on commit cb3e255

Please sign in to comment.