1
0
mirror of https://github.com/SAP/jenkins-library.git synced 2024-12-14 11:03:09 +02:00
sap-jenkins-library/documentation/docs/steps/githubPublishRelease.md
Christopher Fenner f757a0e1d4
fix Markdown issues (#365)
* fix Markdown issue 'Headers should be surrounded by blank lines'

* fix MD012

* fix MD022

* fix MD026

* fix MD007

* fix MD032

* fix MD038

* fix MD040

* fix MD031

* fix MD034

* fix MD004

* fix new findings

* fix MD036

* fix MD038

* fix MD032

* fix MD006
2018-11-06 13:50:09 +01:00

3.3 KiB

githubPublishRelease

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

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.

Example

Usage of pipeline step:

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

Parameters

parameter mandatory default possible values
script yes
addClosedIssues no false
addDeltaToLastRelease no false
customFilterExtension no ``
excludeLabels no
  • duplicate
  • invalid
  • question
  • wontfix
githubApiUrl no //https://api.github.com
githubOrg yes script.commonPipelineEnvironment.getGitFolder()
githubRepo yes script.commonPipelineEnvironment.getGitRepo()
githubServerUrl no https://github.com
githubTokenCredentialsId yes
releaseBodyHeader no
version yes script.commonPipelineEnvironment.getArtifactVersion()

Details

  • script defines the global script environment of the Jenkinsfile run. Typically this is passed to this parameter. This allows the function to access the commonPipelineEnvironment for storing the measured duration.
  • All GitHub related properties allow you to overwrite the default behavior of identifying e.g. GitHub organization, GitHub repository.
  • version defines the version number which will be written as tag as well as release name
  • By defining the releaseBodyHeader you can specify the content which will appear for the release
  • If you set addClosedIssues to true, a list of all closed issues and merged pull-requests since the last release will added below the releaseBodyHeader
  • If you set addDeltaToLastRelease to true, a link will be added to the relese information that brings up all commits since the last release.
  • By passing the parameter customFilterExtension it is possible to pass additional filter criteria for retrieving closed issues since the last release. Additional criteria could be for example specific label, or filter according to GitHub API documentation.
  • It is possible to exclude issues with dedicated labels using parameter excludeLabels. Usage is like excludeLabels: ['label1', 'label2']

Step configuration

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

In following sections the configuration is possible:

parameter general step stage
script
addClosedIssues X X
addDeltaToLastRelease X X
customFilterExtension X X
excludeLabels X X
githubApiUrl X X X
githubOrg X X
githubRepo X X
githubServerUrl X X X
githubTokenCredentialsId X X X
releaseBodyHeader X X
version X X