refs TG-4: added autoReleaswe

This commit is contained in:
2026-05-03 11:41:09 +03:00
parent 322baeb1d3
commit 69dbce3416
Vendored
+4 -4
View File
@@ -43,7 +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')]) { withCredentials([string(credentialsId: 'Gitea_Credentials', variable: 'Gitea_Credentials')]) {
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}",
@@ -54,7 +54,7 @@ pipeline {
"prerelease": false "prerelease": false
}""" }"""
sh """ sh """
curl -X POST ${releaseUrl} -H 'Authorization: token ${GITEA_TOKEN}' -d '${json}' curl -X POST ${releaseUrl} -H 'Authorization: token ${Gitea_Credentials}' -d '${json}'
if [ \$? -ne 0 ]; then if [ \$? -ne 0 ]; then
echo 'Error creating release' echo 'Error creating release'
exit 1 exit 1
@@ -68,10 +68,10 @@ 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')]) { withCredentials([string(credentialsId: 'Gitea_Credentials', variable: 'Gitea_Credentials')]) {
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 """ sh """
curl -X POST ${releaseUploadUrl} -H 'Authorization: token ${GITEA_TOKEN}' -F 'file=@dist/windows/test_app.exe' curl -X POST ${releaseUploadUrl} -H 'Authorization: token ${Gitea_Credentials}' -F 'file=@dist/windows/test_app.exe'
if [ \$? -ne 0 ]; then if [ \$? -ne 0 ]; then
echo 'Error uploading artifact' echo 'Error uploading artifact'
exit 1 exit 1