semantic-release
AboutGitHubNeed Help?
beta
beta
  • Introduction
  • Usage
    • Getting started
    • Installation
    • CI Configuration
    • Configuration
    • Plugins
    • Workflow configuration
    • Shareable configurations
  • Extending
    • Plugins
    • Shareable configuration
  • Recipes
    • CI configurations
      • CircleCI 2.0
      • Travis CI
      • GitLab CI
    • Git hosted services
      • Git authentication with SSH keys
    • Package managers and languages
  • Developer guide
    • JavaScript API
    • Plugin development
    • Shareable configuration development
  • Support
    • Resources
    • Frequently Asked Questions
    • Troubleshooting
    • Node version requirement
    • Node Support Policy
Powered by GitBook
On this page
  • Environment variables
  • Multiple Node jobs configuration
  • .circleci/config.yml configuration for multiple Node jobs
  • package.json configuration for multiple Node jobs
Edit on Git
  1. Recipes
  2. CI configurations

CircleCI 2.0

PreviousCI configurationsNextTravis CI

Last updated 3 years ago

Environment variables

The environment variables can be configured in ..

Alternatively, the default NPM_TOKEN and GH_TOKEN can be easily .

Multiple Node jobs configuration

.circleci/config.yml configuration for multiple Node jobs

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

In this example, the orb is imported (Which makes some node operations easier), then a release job is defined which will run semantic-release.

To run our release job, we have created a workflow named test_and_release which will run two jobs, node/test, which comes from the node orb and will test our application, and our release job. Here, we are actually making use of so that our single node/test job will actually be executed twice, once for Node version 16, and once for version 14. Finally, we call our release job with a requires parameter so that release will only run after node/test has successfully tested against v14 and v16.

version: 2.1
orbs:
  node: circleci/node@4.5
jobs:
  release:
    executor: node/default
    steps:
      - checkout
      - node/install-packages # Install and automatically cache packages
      # Run optional required steps before releasing
      # - run: npm run build-script
      - run: npx semantic-release

workflows:
  test_and_release:
    # Run the test jobs first, then the release only when all the test jobs are successful
    jobs:
      - node/test:
          matrix:
            parameters:
              version:
                - 16.1.0
                - 14.17.0
      - release:
          requires:
            - node/test

package.json configuration for multiple Node jobs

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

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

CircleCi Project Settings
CircleCI documentation
circleci/node
matrix jobs
local
setup with semantic-release-cli
Authentication