Skip to content

Commit

Permalink
Update Jenkinsfile
Browse files Browse the repository at this point in the history
  • Loading branch information
michelu89 committed Feb 5, 2024
1 parent a33fb6f commit e85c4fa
Showing 1 changed file with 16 additions and 3 deletions.
19 changes: 16 additions & 3 deletions .jenkins/Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,22 @@ pipeline {
steps {
script {
def repo = "eclipse-esmf/esmf-aspect-model-editor-backend"
def releaseId = "v5.2.1"
def tagName = "v5.2.1"
def fileName = "signed.exe"
def uploadUrl = "https://uploads.github.com/repos/${repo}/releases/tags/${releaseId}/assets?name=${fileName}"

sh """
curl -L \\
-H "Accept: application/vnd.github+json" \\
-H "Authorization: Bearer <YOUR-TOKEN>" \\
-H "X-GitHub-Api-Version: 2022-11-28" \\
https://api.github.com/repos/${repo}/releases/tags/${tagName}
"""
def releaseId = sh(script: """
curl -s -L \\
-H "Accept: application/vnd.github+json" \\
-H "Authorization: Bearer \$GITHUB_TOKEN" \\
https://api.github.com/repos/${repo}/releases/tags/${tagName} | jq -r '.id'
""", returnStdout: true).trim()

sh """
curl -L \
Expand All @@ -39,7 +52,7 @@ pipeline {
-H "Authorization: Bearer \$GITHUB_TOKEN" \
-H "Content-Type: application/octet-stream" \
--data-binary @${fileName} \
"${uploadUrl}"
"https://uploads.github.com/repos/${repo}/releases/${releaseId}/assets?name=${fileName}"
"""
}
}
Expand Down

0 comments on commit e85c4fa

Please sign in to comment.