@semantic-release/gitlab
semantic-release plugin to publish a GitLab release
Last updated a month ago by semantic-release-bot .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install @semantic-release/gitlab 
SYNC missed versions from official npm registry.

@semantic-release/gitlab

semantic-release plugin to publish a GitLab release.

Travis Codecov Greenkeeper badge

npm latest version npm next version

Step Description
verifyConditions Verify the presence and the validity of the authentication (set via environment variables).
publish Publish a GitLab release.

Install

$ npm install @semantic-release/gitlab -D

Usage

The plugin can be configured in the semantic-release configuration file:

{
  "plugins": [
    "@semantic-release/commit-analyzer",
    "@semantic-release/release-notes-generator",
    ["@semantic-release/gitlab", {
      "gitlabUrl": "https://custom.gitlab.com",
      "assets": [
        {"path": "dist/asset.min.css", "label": "CSS distribution"},
        {"path": "dist/asset.min.js", "label": "JS distribution"}
      ]
    }],
  ]
}

With this example GitLab releases will be published to the https://custom.gitlab.com instance.

Configuration

GitLab authentication

The GitLab authentication configuration is required and can be set via environment variables.

Create a personal access token with the api scope and make it available in your CI environment via the GL_TOKEN environment variable. If you are using GL_TOKEN as the remote Git repository authentication it must also have the write_repository scope.

Environment variables

Variable Description
GL_TOKEN or GITLAB_TOKEN Required. The token used to authenticate with GitLab.
GL_URL or GITLAB_URL The GitLab endpoint.
GL_PREFIX or GITLAB_PREFIX The GitLab API prefix.

Options

Option Description Default
gitlabUrl The GitLab endpoint. GL_URL or GITLAB_URL environment variable or https://gitlab.com.
gitlabApiPathPrefix The GitLab API prefix. GL_PREFIX or GITLAB_PREFIX environment variable or /api/v4.
assets An array of files to upload to the release. See assets. -

assets

Can be a glob or and Array of globs and Objects with the following properties:

Property Description Default
path Required. A glob to identify the files to upload. -
label Short description of the file displayed on the GitLab release. File name extracted from the path.

Each entry in the assets Array is globbed individually. A glob can be a String ("dist/**/*.js" or "dist/mylib.js") or an Array of Strings that will be globbed together (["dist/**", "!**/*.css"]).

If a directory is configured, all the files under this directory and its children will be included.

Note: If a file has a match in assets it will be included even if it also has a match in .gitignore.

assets examples

'dist/*.js': include all the js files in the dist directory, but not in its sub-directories.

[['dist', '!**/*.css']]: include all the files in the dist directory and its sub-directories excluding the css files.

[{path: 'dist/MyLibrary.js', label: 'MyLibrary JS distribution'}, {path: 'dist/MyLibrary.css', label: 'MyLibrary CSS distribution'}]: include the dist/MyLibrary.js and dist/MyLibrary.css files, and label them MyLibrary JS distribution and MyLibrary CSS distribution in the GitLab release.

[['dist/**/*.{js,css}', '!**/*.min.*'], {path: 'build/MyLibrary.zip', label: 'MyLibrary'}]: include all the js and css files in the dist directory and its sub-directories excluding the minified version, plus the build/MyLibrary.zip file and label it MyLibrary in the GitLab release.

Current Tags

  • 4.0.4                                ...           latest (a month ago)
  • 4.0.4                                ...           next (a month ago)

31 Versions

  • 4.0.4                                ...           a month ago
  • 4.0.3                                ...           2 months ago
  • 4.0.2                                ...           2 months ago
  • 4.0.1                                ...           2 months ago
  • 4.0.0                                ...           2 months ago
  • 3.1.7                                ...           5 months ago
  • 3.1.6                                ...           5 months ago
  • 3.1.5                                ...           7 months ago
  • 3.1.4                                ...           7 months ago
  • 3.1.3                                ...           8 months ago
  • 3.1.2                                ...           a year ago
  • 3.1.1                                ...           a year ago
  • 3.1.0                                ...           a year ago
  • 3.0.5                                ...           a year ago
  • 3.0.4                                ...           a year ago
  • 3.0.3                                ...           a year ago
  • 3.0.2                                ...           a year ago
  • 3.0.1                                ...           a year ago
  • 3.0.0                                ...           a year ago
  • 2.1.4                                ...           2 years ago
  • 2.1.3                                ...           2 years ago
  • 2.1.2                                ...           2 years ago
  • 2.1.1                                ...           2 years ago
  • 2.1.0                                ...           2 years ago
  • 2.0.3                                ...           2 years ago
  • 2.0.2                                ...           2 years ago
  • 2.0.1                                ...           2 years ago
  • 2.0.0                                ...           2 years ago
  • 1.0.2                                ...           2 years ago
  • 1.0.1                                ...           2 years ago
  • 1.0.0                                ...           2 years ago

Copyright 2014 - 2016 © taobao.org |