Skip to content
 
 

Latest commit

 

History

5 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

@semantic-release/github

Set of semantic-release plugins for publishing a Github release.

Travis Codecov Greenkeeper badge

verifyConditions

Verify the presence and the validity of the githubToken (set via option or environment variable).

Options

Option Description Default
githubToken Required. The token used to authenticate with GitHub. process.env.GH_TOKEN or process.env.GITHUB_TOKEN
githubUrl The GitHub Enterprise endpoint. process.env.GH_URL or process.env.GITHUB_URL
githubApiPathPrefix The GitHub Enterprise API prefix. process.env.GH_PREFIX or process.env.GITHUB_PREFIX

publish

Publish a Github release.

Options

Option Description Default
githubToken Required. The token used to authenticate with GitHub. process.env.GH_TOKEN or process.env.GITHUB_TOKEN
githubUrl The GitHub Enterprise endpoint. process.env.GH_URL or process.env.GITHUB_URL
githubApiPathPrefix The GitHub Enterprise API prefix. process.env.GH_PREFIX or process.env.GITHUB_PREFIX
assets An array of files to upload to the release. -

assets option

Each element of the array can be a path to the file or an object with the properties:

Property Description Default
path Required. The file path to upload relative to the project directory. -
name The name of the downloadable file on the Github release. File name extracted from the path.
label Short description of the file displayed on the Github release. -

Configuration

The plugins are used by default by semantic-release so no specific configuration is requiered if githubToken, githubUrl and githubApiPathPrefix are set via environment variable.

Each individual plugin can be disabled, replaced or used with other plugins in the package.json:

{
  "release": {
    "verifyConditions": ["@semantic-release/github", "verify-other-condition"],
    "getLastRelease": "custom-get-last-release",
    "publish": [
      "custom-publish",
      {
        "path": "@semantic-release/github",
        "assets": [
          {"path": "dist/asset.min.css", "label": "CSS distribution"},
          {"path": "dist/asset.min.js", "label": "JS distribution"}
        ]
      }
    ]
  }
}

The same configuration for Github Enterprise:

{
  "release": {
    "verifyConditions": [
      {
        "path": "@semantic-release/github",
        "githubUrl": "https://my-ghe.com",
        "githubApiPathPrefix": "/api-prefix"
      },
      "verify-other-condition"
    ],
    "getLastRelease": "custom-get-last-release",
    "publish": [
      "custom-publish",
      {
        "path": "@semantic-release/github",
        "githubUrl": "https://my-ghe.com",
        "githubApiPathPrefix": "/api-prefix",
        "assets": [
          {"path": "dist/asset.min.css", "label": "CSS distribution"},
          {"path": "dist/asset.min.js", "label": "JS distribution"}
        ]
      }
    ]
  }
}

About

Set of semantic-release plugins for publishing a Github release

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages