Skip to content

Latest commit

 

History

History
57 lines (41 loc) · 1.76 KB

gitlab-ci.md

File metadata and controls

57 lines (41 loc) · 1.76 KB

Using semantic-release with GitLab CI

Environment variables

The Authentication environment variables can be configured with Secret variables.

Node project configuration

GitLab CI supports Pipelines allowing to test on multiple Node versions and publishing a release only when all test pass.

Note: The publish pipeline must run a Node >= 8.16 version.

.gitlab-ci.yml configuration for Node projects

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 for additional configuration options.

Note: Thesemantic-release execution command varies depending if you are using a local or global semantic-release installation.

# The release pipeline will run only if all jobs in the test pipeline are successful
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

package.json configuration

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

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