Skip to content

Commit

Permalink
docs: update recipe for gitlab-ci with Node.js >=10.18
Browse files Browse the repository at this point in the history
Signed-off-by: solidnerd <niclas@mietz.io>
  • Loading branch information
solidnerd authored and gr2m committed Apr 22, 2020
1 parent d64db31 commit 22321cf
Showing 1 changed file with 41 additions and 6 deletions.
47 changes: 41 additions & 6 deletions docs/recipes/gitlab-ci.md
Expand Up @@ -14,7 +14,7 @@ GitLab CI supports [Pipelines](https://docs.gitlab.com/ee/ci/pipelines.html) all

### `.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](https://docs.gitlab.com/ee/ci/yaml/README.html) for additional configuration options.
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](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#local-installation) or [global](../usage/installation.md#global-installation) **semantic-release** installation.

Expand All @@ -27,25 +27,60 @@ stages:
before_script:
- npm install

node:6:
image: node:6
node:10:
image: node:10
stage: test
script:
- npm test

node:8:
image: node:8
node:12:
image: node:12
stage: test
script:
- npm test

publish:
image: node:8
image: node:12
stage: release
script:
- npx semantic-release
```

### `.gitlab-ci.yml` configuration for all projects

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](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#local-installation) or [global](../usage/installation.md#global-installation) **semantic-release** installation.


```yaml
# The release pipeline will run only on the master branch a commit is triggered
stages:
- release

release:
image: node:10-buster-slim
stage: release
before_script:
- apt-get update && apt-get install -y --no-install-recommends git-core ca-certificates
- npm install -g semantic-release @semantic-release/gitlab
script:
- semantic-release
only:
- master

release:
image: node:12-buster-slim
stage: release
before_script:
- apt-get update && apt-get install -y --no-install-recommends git-core ca-certificates
- npm install -g semantic-release @semantic-release/gitlab
script:
- semantic-release
only:
- master
```

### `package.json` configuration

A `package.json` is required only for [local](../usage/installation.md#local-installation) **semantic-release** installation.
Expand Down

0 comments on commit 22321cf

Please sign in to comment.