Travis CI
Environment variables
The Authentication environment variables can be configured in Travis Repository Settings or with the travis env set CLI.
Alternatively, the default NPM_TOKEN
and GH_TOKEN
can be easily setup with semantic-release-cli.
Node.js projects configuration
.travis.yml
configuration for multiple Node.js jobs
.travis.yml
configuration for multiple Node.js jobsThis example is a minimal configuration for semantic-release with a build running Node 14 and 16. See Travis - Customizing the Build for additional configuration options.
This example creates a release
build stage that runs semantic-release
only after all test jobs are successful.
It's recommended to run the semantic-release
command in the Travis deploy
step so if an error occurs the build will fail and Travis will send a notification.
Note: It's not recommended to run the semantic-release
command in the Travis script
step as each script in this step will be executed regardless of the outcome of the previous one. See travis-ci/travis-ci#1066.
Advanced configuration: Running the tests in the script
step of the release
stage is not necessary as the previous stage(s) already ran them. To increase speed, the script
step of the release
stage can be overwritten to skip the tests. Note that other commands such as build or compilation might still be required.
package.json
configuration for multiple Node jobs
package.json
configuration for multiple Node jobsA package.json
is required only for local semantic-release installation.
Non-Node.js projects configuration
For projects that require to be tested with one or multiple version of a Non-JavaScript language, optionally on multiple Operating Systems.
This recipe cover the Travis specifics only. See Non JavaScript projects recipe for more information on the semantic-release configuration.
.travis.yml
configuration for non-JavaScript projects
.travis.yml
configuration for non-JavaScript projectsThis example is a minimal configuration for semantic-release with a build running Go 1.6 and 1.7. See Travis - Customizing the Build for additional configuration options.
This example creates a release
build stage that runs semantic-release
only after all test jobs are successful.
It's recommended to run the semantic-release
command in the Travis deploy
step so if an error occurs the build will fail and Travis will send a notification.
Note: It's not recommended to run the semantic-release
command in the Travis script
step as each script in this step will be executed regardless of the outcome of the previous one. See travis-ci/travis-ci#1066.
Advanced configuration: Running the tests in the script
step of the release
stage is not necessary as the previous stage(s) already ran them. To increase speed, the script
step of the release
stage can be overwritten to skip the tests. Note that other commands such as build or compilation might still be required.
Last updated