Skip to content

githubPublishRelease

Prerequisites

You need to create a personal access token within GitHub and add this to the Jenkins credentials store.

Please see GitHub documentation for details about creating the personal access token.

Parameters

name mandatory default possible values
addClosedIssues No false true, false
addDeltaToLastRelease No false true, false
apiUrl No https://api.github.com
assetPath No
commitish No master
excludeLabels No
githubTokenCredentialsId Yes
labels No
owner Yes
preRelease No false true, false
releaseBodyHeader No
repository Yes
script Yes
serverUrl No https://github.com
token Yes
uploadUrl No https://uploads.github.com
verbose No false true, false
version Yes
  • addClosedIssues: If set to true, closed issues and merged pull-requests since the last release will added below the releaseBodyHeader
  • addDeltaToLastRelease: If set to true, a link will be added to the relese information that brings up all commits since the last release.
  • apiUrl: Set the GitHub API url.
  • assetPath: Path to a release asset which should be uploaded to the list of release assets.
  • commitish: Target git commitish for the release
  • excludeLabels: Allows to exclude issues with dedicated list of labels.
  • githubTokenCredentialsId: Jenkins 'Secret text' credentials ID containing token to authenticate to GitHub.
  • labels: Labels to include in issue search.
  • owner: Set the GitHub organization.
  • preRelease: If set to true the release will be marked as Pre-release.
  • releaseBodyHeader: Content which will appear for the release.
  • repository: Set the GitHub repository.
  • script: The common script environment of the Jenkinsfile running. Typically the reference to the script calling the pipeline step is provided with the this parameter, as in script: this. This allows the function to access the commonPipelineEnvironment for retrieving, e.g. configuration parameters.
  • serverUrl: GitHub server url for end-user access.
  • token: GitHub personal access token as per https://help.github.com/en/github/authenticating-to-github/creating-a-personal-access-token-for-the-command-line
  • uploadUrl: Set the GitHub API url.
  • verbose: verbose output
  • version: Define the version number which will be written as tag as well as release name.

Step Configuration

We recommend to define values of step parameters via config.yml file.

In following sections of the config.yml the configuration is possible:

parameter general step/stage
addClosedIssues X
addDeltaToLastRelease X
apiUrl X X
assetPath X
commitish X
excludeLabels X
labels X
owner X
preRelease X
releaseBodyHeader X
repository X
serverUrl X X
token X X
uploadUrl X X
verbose X
version X

Description

This step creates a tag in your GitHub repository together with a release. The release can be filled with text plus additional information like:

  • Closed pull request since last release
  • Closed issues since last release
  • Link to delta information showing all commits since last release

The result looks like

Example release

Example

Usage of pipeline step:

githubPublishRelease script: this, releaseBodyHeader: "**This is the latest success!**<br />"