semantic-release/docs/usage/ci-configuration.md
2018-01-05 16:05:30 -05:00

3.6 KiB

CI configuration

Run semantic-release only after all tests succeeded

The semantic-release command must be executed only after all the tests in the CI build pass. If the build runs multiple jobs (for example to test on multiple Operating Systems or Node versions) the CI has to be configured to guarantee that the semantic-release command is executed only after all jobs are successful. This can be achieved with Travis Build Stages, CircleCI Workflows, Codeship Deployment Pipelines, GitLab Pipelines, Wercker Workflows, GoCD Pipelines or specific tools like travis-deploy-once.

See CI configuration recipes for more details.

Authentication

Most semantic-release plugins require to set up authentication in order to publish to your package manager's registry or to access your project's Git hosted service. The authentication token/credentials have to be made available in the CI serice via environment variables.

See each plugin documentation for the environment variable to set up.

The default npm and github plugins require the following environment variables:

Variable Description
NPM_TOKEN npm token created via npm token create.
Note: Only the auth-only level of npm two-factor authentication is supported.
GH_TOKEN GitHub authentication token.
Note: Only the personal token authentication is supported.

See CI configuration recipes for more details on how to configure environment variables in your CI service.

Automatic setup with semantic-release-cli

semantic-release-cli allow to easily install semantic-release in your Node project and set up the CI configuration:

npm install -g semantic-release-cli

cd your-module
semantic-release-cli setup

dialogue

See the semantic-release-cli documentation for more details.