semantic-release
Version:
Automated semver compliant package publishing
60 lines (42 loc) • 2.02 kB
Markdown
The [Authentication](../usage/ci-configuration.md
**Note**: Make sure to configure your release branch as [protected](https://docs.gitlab.com/ce/user/project/protected_branches.html) in order for the CI/CD build to access the protected variables.
GitLab CI supports [Pipelines](https://docs.gitlab.com/ee/ci/pipelines.html) allowing to test on multiple Node versions and publishing a release only when all test pass.
**Note**: The publish pipeline must run a [Node >= 10.13 version](../support/FAQ.md
This example is a minimal configuration for **semantic-release** with a build running Node 6 and 8. See [GitLab CI - Configuration of your jobs with .gitlab-ci.yml](https://docs.gitlab.com/ee/ci/yaml/README.html) for additional configuration options.
**Note**: The`semantic-release` execution command varies depending if you are using a [local](../usage/installation.md
```yaml
stages:
- test
- release
before_script:
- npm install
node:6:
image: node:6
stage: test
script:
- npm test
node:8:
image: node:8
stage: test
script:
- npm test
publish:
image: node:8
stage: release
script:
- npx semantic-release
```
A `package.json` is required only for [local](../usage/installation.md
```json
{
"devDependencies": {
"semantic-release": "^15.0.0"
}
}
```