semantic-release
AboutGitHubNeed Help?
master
master
  • README
  • Usage
    • Getting started
    • Installation
    • CI Configuration
    • Configuration
    • Plugins
    • Release Workflow configuration
    • Shareable configurations
  • Extending
    • Plugins
    • Shareable configuration
  • Recipes
    • CI configurations
      • CircleCI 2.0
      • Travis CI
      • GitLab CI
      • GitHub Actions
      • Jenkins CI
    • Git hosted services
      • Git authentication with SSH keys
    • Release Workflow
      • Publishing on distribution channels
      • Publishing maintenance releases
      • Publishing pre-releases
  • Developer guide
    • JavaScript API
    • Plugin development
    • Shareable configuration development
  • Support
    • Resources
    • Frequently Asked Questions
    • Troubleshooting
    • Node version requirement
    • Node Support Policy
    • Git version requirement
Powered by GitBook
On this page
  • Environment variables
  • Node.js projects configuration
  • .travis.yml configuration for multiple Node.js jobs
  • package.json configuration for multiple Node jobs
  • Non-Node.js projects configuration
  • .travis.yml configuration for non-JavaScript projects
Edit on GitHub
  1. Recipes
  2. CI configurations

Travis CI

PreviousCircleCI 2.0NextGitLab CI

Last updated 3 years ago

Environment variables

The environment variables can be configured in or with the .

Alternatively, the default NPM_TOKEN and GH_TOKEN can be easily .

Node.js projects configuration

.travis.yml configuration for multiple Node.js jobs

This example is a minimal configuration for semantic-release with a build running Node 14 and 16. See for additional configuration options.

This example creates a release that .

It's recommended to run the semantic-release command in the 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 .

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.

language: node_js

node_js:
  - 14
  - 16

jobs:
  include:
    # Define the release stage that runs semantic-release
    - stage: release
      node_js: lts/*
      # Advanced: optionally overwrite your default `script` step to skip the tests
      # script: skip
      deploy:
        provider: script
        skip_cleanup: true
        script:
          - npx semantic-release

package.json configuration for multiple Node jobs

{
  "devDependencies": {
    "semantic-release": "^18.0.0"
  }
}

Non-Node.js projects configuration

.travis.yml configuration for non-JavaScript projects

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.

language: go

go:
  - 1.6
  - 1.7

jobs:
  include:
    # Define the release stage that runs semantic-release
    - stage: release
      # Advanced: optionally overwrite your default `script` step to skip the tests
      # script:
      #   - make
      deploy:
        provider: script
        skip_cleanup: true
        script:
          # Use nvm to install and use the Node LTS version (nvm is installed on all Travis images)
          - nvm install lts/*
          - npx semantic-release
        on:
          all_branches: true

A package.json is required only for semantic-release installation.

For projects that require to be tested with one or multiple version of a Non-JavaScript , optionally on multiple .

This recipe cover the Travis specifics only. See for more information on the semantic-release configuration.

This example is a minimal configuration for semantic-release with a build running . See for additional configuration options.

This example creates a release that .

It's recommended to run the semantic-release command in the 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 .

language
Operating Systems
Go 1.6 and 1.7
Travis - Customizing the Build
Travis deploy step
travis-ci/travis-ci#1066
Travis Repository Settings
travis env set CLI
Travis - Customizing the Build
build stage
Travis deploy step
travis-ci/travis-ci#1066
build stage
setup with semantic-release-cli
Authentication
runs semantic-release only after all test jobs are successful
runs semantic-release only after all test jobs are successful
local
Non JavaScript projects recipe