The Authentication environment variables can be configured with Protected variables.
Note: Make sure to configure your release branch as protected in order for the CI/CD build to access the protected variables.
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 >= 10.18 version.
This example is a minimal configuration for semantic-release with a build running Node 10 and 12. 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 successfulstages:- test- release​before_script:- npm install​node:10:image: node:10stage: testscript:- npm test​node:12:image: node:12stage: testscript:- npm test​publish:image: node:12stage: releasescript:- npx semantic-release
This example is a minimal configuration for semantic-release with a build running Node 10 and 12. 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 on the master branch a commit is triggeredstages:- release​release:image: node:10-buster-slimstage: releasebefore_script:- apt-get update && apt-get install -y --no-install-recommends git-core ca-certificates- npm install -g semantic-release @semantic-release/gitlabscript:- semantic-releaseonly:- master​release:image: node:12-buster-slimstage: releasebefore_script:- apt-get update && apt-get install -y --no-install-recommends git-core ca-certificates- npm install -g semantic-release @semantic-release/gitlabscript:- semantic-releaseonly:- master
A package.json
is required only for local semantic-release installation.
{"devDependencies": {"semantic-release": "^15.0.0"}}