refs TG-4: added autoReleaswe
This commit is contained in:
Vendored
+18
-2
@@ -43,6 +43,7 @@ pipeline {
|
|||||||
stage('Upload Artifacts to Gitea') {
|
stage('Upload Artifacts to Gitea') {
|
||||||
steps {
|
steps {
|
||||||
script {
|
script {
|
||||||
|
withCredentials([string(credentialsId: 'GITEA_TOKEN', variable: 'GITEA_TOKEN')]) {
|
||||||
def releaseUrl = "https://git.grigowashere.ru/api/v1/repos/username/repo/releases"
|
def releaseUrl = "https://git.grigowashere.ru/api/v1/repos/username/repo/releases"
|
||||||
def json = """{
|
def json = """{
|
||||||
"tag_name": "v${BUILD_NUMBER}",
|
"tag_name": "v${BUILD_NUMBER}",
|
||||||
@@ -52,7 +53,14 @@ pipeline {
|
|||||||
"draft": false,
|
"draft": false,
|
||||||
"prerelease": false
|
"prerelease": false
|
||||||
}"""
|
}"""
|
||||||
sh "curl -X POST ${releaseUrl} -H 'Authorization: token ${GITEA_TOKEN}' -d '${json}'"
|
sh """
|
||||||
|
curl -X POST ${releaseUrl} -H 'Authorization: token ${GITEA_TOKEN}' -d '${json}'
|
||||||
|
if [ \$? -ne 0 ]; then
|
||||||
|
echo 'Error creating release'
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
"""
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -60,8 +68,16 @@ pipeline {
|
|||||||
stage('Upload Artifacts to Gitea Release') {
|
stage('Upload Artifacts to Gitea Release') {
|
||||||
steps {
|
steps {
|
||||||
script {
|
script {
|
||||||
|
withCredentials([string(credentialsId: 'GITEA_TOKEN', variable: 'GITEA_TOKEN')]) {
|
||||||
def releaseUploadUrl = "https://git.grigowashere.ru/api/v1/repos/username/repo/releases/tags/v${BUILD_NUMBER}/assets"
|
def releaseUploadUrl = "https://git.grigowashere.ru/api/v1/repos/username/repo/releases/tags/v${BUILD_NUMBER}/assets"
|
||||||
sh "curl -X POST ${releaseUploadUrl} -H 'Authorization: token ${GITEA_TOKEN}' -F 'file=@dist/windows/test_app.exe'"
|
sh """
|
||||||
|
curl -X POST ${releaseUploadUrl} -H 'Authorization: token ${GITEA_TOKEN}' -F 'file=@dist/windows/test_app.exe'
|
||||||
|
if [ \$? -ne 0 ]; then
|
||||||
|
echo 'Error uploading artifact'
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
"""
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user