Skip to content
Branch: master
Find file Copy path
Find file Copy path
1 contributor

Users who have contributed to this file

54 lines (36 sloc) 5.22 KB

CI configuration

Running semantic-release

The semantic-release command will only run fully in a CI environment. If it does not detect that it is in a CI environment, it will automatically run in dry-run mode.

Within a CI environment, the semantic-release command must be executed only after all the tests in the CI build pass, otherwise it will release potentially faulty code. 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.

Follow the CI system's documentation to find out how to do this:

This documentation provides a few CI pipelines recipes for more details.


Push access to remote repos

semantic-release requires push access to remote Git repositories in order to push the Git tags it created.

The Git authentication can be set with one of the following environment variables:

Variable Description
GH_TOKEN or GITHUB_TOKEN A GitHub personal access token.
GL_TOKEN or GITLAB_TOKEN A GitLab personal access token.
BB_TOKEN or BITBUCKET_TOKEN A Bitbucket personal access token.
GIT_CREDENTIALS URL encoded Git username and password in the format <username>:<password>. The username and password must each be individually URL encoded, not the : separating them.

Alternatively the Git authentication can be set up via SSH keys.

Authentication needs for plugins

Most semantic-release plugins require setting up authentication in order to publish to a package manager registry. See each plugin's documentation for the environment variables required.

It is to note, however, that:

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

See each plugin's documentation for the environment variables required.

Note: The authentication token/credentials have to be made available in the CI service via environment variables.

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

You can’t perform that action at this time.