refs TG-3: added autoReleaswe

This commit is contained in:
2026-05-03 17:20:05 +03:00
parent 232fb9b2e5
commit 9e832ce9fa
Vendored
+22 -17
View File
@@ -10,7 +10,6 @@ pipeline {
TAIGA_URL = 'https://taiga.grigowashere.ru'
GITEA_OWNER = 'Grigo'
GITEA_REPO = 'TestingAndroidBuild'
}
stages {
@@ -35,14 +34,23 @@ pipeline {
withCredentials([string(credentialsId: 'Gitea_Credentials', variable: 'GITEA_TOKEN')]) {
writeFile file: 'gitea-release.sh', text: '''
#!/bin/bash
#!/bin/bash
apkPath="build/outputs/apk/debug/app-debug.apk"
# Define the APK file path
apkPath="build/outputs/apk/debug/app-debug.apk"
headers="Authorization: token $GITEA_TOKEN"
# Check if the APK exists
if [ ! -f "$apkPath" ]; then
echo "APK file does not exist at $apkPath"
exit 1
fi
# Create the release on Gitea
release=$(curl -X POST "https://git.grigowashere.ru/api/v1/repos/$GITEA_OWNER/$GITEA_REPO/releases" \
echo "APK file exists: $apkPath"
headers="Authorization: token $GITEA_TOKEN"
# Create the release on Gitea
release=$(curl -X POST "https://git.grigowashere.ru/api/v1/repos/$GITEA_OWNER/$GITEA_REPO/releases" \
-H "$headers" \
-H "Content-Type: application/json" \
-d '{
@@ -54,21 +62,21 @@ pipeline {
"prerelease": false
}')
releaseId=$(echo $release | jq -r .id)
releaseId=$(echo $release | jq -r .id)
# Form URL for uploading APK asset
uploadUrl="https://git.grigowashere.ru/api/v1/repos/$GITEA_OWNER/$GITEA_REPO/releases/$releaseId/assets?name=app-debug.apk"
# Form URL for uploading APK asset
uploadUrl="https://git.grigowashere.ru/api/v1/repos/$GITEA_OWNER/$GITEA_REPO/releases/$releaseId/assets?name=app-debug.apk"
# Upload APK file to Gitea
curl -X POST "$uploadUrl" \
# Upload APK file to Gitea
curl -X POST "$uploadUrl" \
-H "$headers" \
-F "attachment=@$apkPath;type=application/vnd.android.package-archive"
if [ $? -ne 0 ]; then
if [ $? -ne 0 ]; then
echo "Gitea asset upload failed: $apkPath"
exit 1
fi
'''
fi
'''
sh '''
chmod +x gitea-release.sh
@@ -77,8 +85,6 @@ pipeline {
}
}
}
}
post {
@@ -104,7 +110,6 @@ pipeline {
import json
import os
import urllib.request
import urllib.error
taiga_url = os.environ["TAIGA_URL"]
project_id = os.environ["TAIGA_PROJECT_ID"]