Skip to content

Commit

Permalink
feat: use new plugins option
Browse files Browse the repository at this point in the history
- Use new semantic-release `plugins` option
- Update documentation
- Remove test as the shareable config is purely static

BREAKING CHANGE: require [email protected] or above
  • Loading branch information
pvdlg committed Dec 1, 2018
1 parent 74d8ddf commit 332f5c6
Show file tree
Hide file tree
Showing 8 changed files with 28 additions and 547 deletions.
63 changes: 14 additions & 49 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,72 +1,37 @@
# @semantic-release/gitlab-config

[Semantic-release](https://github.com/semantic-release/semantic-release) shareable config for [GitLab](https://gitlab.com).
[**semantic-release**](https://github.com/semantic-release/semantic-release) shareable config to publish npm packages with [GitLab](https://gitlab.com).

[![Travis](https://img.shields.io/travis/semantic-release/gitlab-config.svg)](https://travis-ci.org/semantic-release/gitlab-config)
[![Codecov](https://img.shields.io/codecov/c/github/semantic-release/gitlab-config.svg)](https://codecov.io/gh/semantic-release/gitlab-config)
[![Greenkeeper badge](https://badges.greenkeeper.io/semantic-release/gitlab-config.svg)](https://greenkeeper.io/)

[![npm latest version](https://img.shields.io/npm/v/@semantic-release/gitlab-config/latest.svg)](https://www.npmjs.com/package/@semantic-release/gitlab-config)
[![npm next version](https://img.shields.io/npm/v/@semantic-release/gitlab-config/next.svg)](https://www.npmjs.com/package/@semantic-release/gitlab-config)

## Usage
## Plugins

This shareable configuration use the following plugins:
- [`@semantic-release/commit-analyzer`](https://github.com/semantic-release/commit-analyzer)
- [`@semantic-release/release-notes-generator`](https://github.com/semantic-release/release-notes-generator)
- [`@semantic-release/npm`](https://github.com/semantic-release/npm)
- [`@semantic-release/gitlab`](https://github.com/semantic-release/gitlab)

### Local installation
## Install

```bash
$ npm install --save-dev semantic-release @semantic-release/gitlab-config
```

In `package.json`:
## Usage

The shareable config can be configured in the [**semantic-release** configuration file](https://github.com/semantic-release/semantic-release/blob/master/docs/usage/configuration.md#configuration):

```json
{
"release": {
"extends": "@semantic-release/gitlab-config"
}
"extends": "@semantic-release/gitlab-config"
}
```

### Global installation

```bash
$ npm install -g semantic-release @semantic-release/gitlab-config
$ semantic-release -e @semantic-release/gitlab-config
```

## Configuration

### GitLab authentication

The GitLab authentication configuration is **required** and can be set via [environment variables](#environment-variables).

See [GitLab authentication](https://github.com/semantic-release/gitlab#gitlab-authentication).

### Npm registry authentication

The npm authentication configuration is **required** and can be set via [environment variables](#environment-variables).

See [Npm registry authentication](https://github.com/semantic-release/npm#npm-registry-authentication)

### Environment variables

| Variable | Description |
|------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------|
| `GL_TOKEN` or `GITLAB_TOKEN` | **Required.** The token used to authenticate with GitLab repository. |
| `NPM_TOKEN` | **Required.** Npm token created via [npm token create](https://docs.npmjs.com/getting-started/working_with_tokens#how-to-create-new-tokens) |

### Additional options

This shareable config uses the [`@semantic-release/npm`](https://github.com/semantic-release/npm) and [`@semantic-release/gitlab`](https://github.com/semantic-release/gitlab) plugins. See the documentation of each plugins for additional options.
Options can be set in the Semantic-release configuration.

For example to set a custom GitLab URL:

```json
{
"release": {
"extends": "@semantic-release/gitlab-config",
"gitlabUrl": "https://custom.gitlab.com"
}
}
```
See each [plugin](#plugins) documentation for required installation and configuration steps.
11 changes: 6 additions & 5 deletions index.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
module.exports = {
verifyConditions: ['@semantic-release/npm', '@semantic-release/gitlab'],
prepare: ['@semantic-release/npm'],
publish: ['@semantic-release/npm', '@semantic-release/gitlab'],
success: false,
fail: false,
plugins: [
'@semantic-release/commit-analyzer',
'@semantic-release/release-notes-generator',
'@semantic-release/npm',
'@semantic-release/gitlab',
],
};
43 changes: 8 additions & 35 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@semantic-release/gitlab-config",
"description": "Semantic-release shareable config for GitLab",
"description": "semantic-release shareable config to publish npm packages with GitLab",
"version": "0.0.0-development",
"author": "Pierre Vanduynslager (https://github.com/pvdlg)",
"bugs": {
Expand All @@ -16,28 +16,15 @@
"Gregor Martynus (https://twitter.com/gr2m)"
],
"dependencies": {
"@semantic-release/gitlab": "^3.0.0",
"@semantic-release/npm": "^5.0.1"
"@semantic-release/commit-analyzer": "^6.1.0",
"@semantic-release/gitlab": "^3.1.0",
"@semantic-release/npm": "^5.1.1",
"@semantic-release/release-notes-generator": "^7.1.4"
},
"devDependencies": {
"ava": "^0.25.0",
"codecov": "^3.0.0",
"commitizen": "^3.0.0",
"cz-conventional-changelog": "^2.0.0",
"delay": "^4.0.0",
"dockerode": "^2.5.3",
"execa": "^1.0.0",
"fs-extra": "^7.0.0",
"get-stream": "^4.0.0",
"git-log-parser": "^1.2.0",
"got": "^9.0.0",
"mockserver-client": "^5.3.0",
"nyc": "^12.0.1",
"p-retry": "^2.0.0",
"semantic-release": "^15.8.0",
"sinon": "^6.0.0",
"strip-ansi": "^5.0.0",
"tempy": "^0.2.1",
"semantic-release": "^15.10.0",
"xo": "^0.23.0"
},
"engines": {
Expand All @@ -57,19 +44,8 @@
],
"license": "MIT",
"main": "index.js",
"nyc": {
"include": [
"index.js"
],
"reporter": [
"json",
"text",
"html"
],
"all": true
},
"peerDependencies": {
"semantic-release": ">=15.9.0 <16.0.0"
"semantic-release": ">=15.10.0 <16.0.0"
},
"prettier": {
"printWidth": 120,
Expand All @@ -85,11 +61,8 @@
},
"scripts": {
"cm": "git-cz",
"codecov": "codecov -f coverage/coverage-final.json",
"lint": "xo",
"pretest": "npm run lint",
"semantic-release": "semantic-release",
"test": "nyc ava -v"
"test": "xo"
},
"xo": {
"prettier": true,
Expand Down
79 changes: 0 additions & 79 deletions test/helpers/git-utils.js

This file was deleted.

71 changes: 0 additions & 71 deletions test/helpers/gitbox.js

This file was deleted.

Loading

0 comments on commit 332f5c6

Please sign in to comment.