CircleCI 2.0

Environment variables

The Authentication environment variables can be configured in CircleCi Project Settings..
Alternatively, the default NPM_TOKEN and GH_TOKEN can be easily setup with semantic-release-cli.

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 CircleCI documentation for additional configuration options.
In this example, the circleci/node 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 matrix jobs 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 run against the latest LTS version of node, only after node/test has successfully tested against v14 and v16.
1
version: 2.1
2
orbs:
3
node: circleci/[email protected]
4
jobs:
5
release:
6
executor: node/default
7
steps:
8
- checkout
9
- node/install
10
lts: true
11
- node/install-packages # Install and automatically cache packages
12
# Run optional required steps before releasing
13
# - run: npm run build-script
14
- run: npx semantic-release
15
​
16
workflows:
17
test_and_release:
18
# Run the test jobs first, then the release only when all the test jobs are successful
19
jobs:
20
- node/test:
21
matrix:
22
parameters:
23
version:
24
- 16.1.0
25
- 14.17.0
26
- release:
27
requires:
28
- node/test
Copied!
Last modified 16d ago