Skip to content

Commit 29922b9

Browse files
authored
Make GitHub Releases with Jenkins (#436)
1 parent 529524d commit 29922b9

File tree

1 file changed

+27
-0
lines changed

1 file changed

+27
-0
lines changed

Jenkinsfile

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,33 @@ pipeline {
132132
}
133133
}
134134
}
135+
stage('Make Github Release') {
136+
when {
137+
tag 'v*'
138+
}
139+
steps {
140+
writeFile file: 'release_description.md', text: 'A new version of TLS-Scanner was released. You can download the artifacts (executable .jar) below. \n\n## Changelog:\n - TODO'
141+
sh "zip -r TLS-Scanner-${TAG_NAME}.zip apps"
142+
script {
143+
def draftRelease = createGitHubRelease(
144+
credentialId: '1522a497-e78a-47ee-aac5-70f071fa6714',
145+
repository: GIT_URL.tokenize("/.")[-3,-2].join("/"),
146+
draft: true,
147+
tag: TAG_NAME,
148+
name: TAG_NAME,
149+
bodyFile: 'release_description.md',
150+
commitish: GIT_COMMIT)
151+
uploadGithubReleaseAsset(
152+
credentialId: '1522a497-e78a-47ee-aac5-70f071fa6714',
153+
repository: GIT_URL.tokenize("/.")[-3,-2].join("/"),
154+
tagName: draftRelease.htmlUrl.tokenize("/")[-1],
155+
uploadAssets: [
156+
[filePath: "${env.WORKSPACE}/TLS-Scanner-${TAG_NAME}.zip"]
157+
]
158+
)
159+
}
160+
}
161+
}
135162
}
136163
post {
137164
always {

0 commit comments

Comments
 (0)