semantic-release is running:
- on Travis CI
- on the right git branch and not on a PR build
- only after all other Travis jobs are successful (using travis-deploy-once)
||Required. The Github token used to authenticate with Travis API.||
||The GitHub Enterprise endpoint.||
||The GitHub Enterprise API prefix.||
||The Travis Enterprise endpoint.||
The plugin is used by default by semantic-release so no specific configuration is required if
travisUrl are set via environment variable.
semantic-release require Node node version >= 8, so at least one Travis job as to run on Node 8 (or greater).
With one job
No specific configuration is required.
semantic-release will run on the only Travis job.
language: node_js node_js: - 8 after_success: - npm run semantic-release
With multiple jobs on different Node versions and OS
If there are multiple Node versions and OSs configured, travis-deploy-once will guarantee that
semantic-release is executed on the highest Node version, after all other jobs are successful, without any additional configurations.
language: node_js node_js: - 8 - 6 - 4 os: - linux - osx after_success: - npm run semantic-release
In this example Travis will run 6 jobs (Node 8/Linux, Node 8/ OSX, Node 6/Linux etc...) and
semantic-release will be executed on Node 8 on Linux, only after the 5 other jobs are successful.
Using Travis Build stages
Travis support Build Stages for more complex workflows. It's possible to use
semantic-release with Build Stages by configuring the environment variable
BUILD_LEADER_ID to defined which job will run
The build stage configuration has to guarantee that the job configured with
BUILD_LEADER_ID will run only after all other jobs are successful.
language: node_js node_js: - 8 - 6 - 4 os: - linux - osx env: - BUILD_LEADER_ID=7 jobs: include: - stage: release node_js: 8 os: linux after_success: - npm run semantic-release
In this example Travis will run 6 jobs in the default stage (Node 4, 6 and 8 on Linux and OSX) and if those 6 jobs are successful the release stage will run the 7th job (on Node 8 / Linux) that will execute
The environment variable
BUILD_LEADER_ID is set to
semantic-release should run on the 7th job.