From 0cf66f18dc8f9b15da26e9b3a8394b75c00a887b Mon Sep 17 00:00:00 2001 From: Faumaray Date: Sun, 19 Oct 2025 04:23:43 +0300 Subject: [PATCH] trying to fix release Signed-off-by: Faumaray --- Jenkinsfile | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index 5aab4ec..b6ed097 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -60,19 +60,28 @@ pipeline { REPO="VoidLoader/VoidLoaderCore" TAG="build-${BUILD_NUMBER}" + # Create release if it does not exist 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 + # Get release ID + RELEASE_ID=$(curl -s -H "Authorization: token $GITEA_TOKEN" \ + "$GITEA_URL/api/v1/repos/$REPO/releases/tags/$TAG" | jq -r '.id') + + echo "Release ID = $RELEASE_ID" + + # Upload asset curl -X POST -H "Authorization: token $GITEA_TOKEN" \ -F "attachment=@VoidLoader.zip" \ - "$GITEA_URL/api/v1/repos/$REPO/releases/$TAG/assets" + "$GITEA_URL/api/v1/repos/$REPO/releases/$RELEASE_ID/assets" ''' } } } + } }