diff --git a/Jenkinsfile b/Jenkinsfile index 70586f6..5aab4ec 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -52,6 +52,27 @@ pipeline { } } } + stage('Publish-To-Gitea') { + steps { + withCredentials([string(credentialsId: 'GITEA_TOKEN', variable: 'GITEA_TOKEN')]) { + sh ''' + GITEA_URL="https://git.faumaray.ru" + REPO="VoidLoader/VoidLoaderCore" + TAG="build-${BUILD_NUMBER}" + + curl -X POST -H "Authorization: token $GITEA_TOKEN" \ + -H "Content-Type: application/json" \ + -d "{\\"tag_name\\": \\"$TAG\\", \\"name\\": \\"$TAG\\"}" \ + $GITEA_URL/api/v1/repos/$REPO/releases || true + + curl -X POST -H "Authorization: token $GITEA_TOKEN" \ + -F "attachment=@VoidLoader.zip" \ + "$GITEA_URL/api/v1/repos/$REPO/releases/$TAG/assets" + ''' + } + } + } + } }