feat(packaging): include Inno Setup installers, Linux scripts, and bundles in release distribution
CI Test Suite / Run Component Tests & Pipeline Verification (push) Successful in 1m29s

This commit is contained in:
2026-09-26 13:20:41 +02:00
parent a496b7e822
commit b0bf322275
4 changed files with 78 additions and 9 deletions
+17 -5
View File
@@ -13,9 +13,21 @@ import time
DEFAULT_GITEA_URL = os.environ.get("GITEA_SERVER_URL", "https://gitea.eibl.tech")
DEFAULT_REPO = os.environ.get("GITEA_REPOSITORY", "me0nline/LOGAR")
import base64
def get_auth_header(token):
if not token:
return ""
if token.startswith("Basic ") or token.startswith("token ") or token.startswith("Bearer "):
return token
if ":" in token:
b64 = base64.b64encode(token.encode("utf-8")).decode("ascii")
return f"Basic {b64}"
return f"token {token}"
def get_existing_assets(base_url, repo, release_id, token):
url = f"{base_url}/api/v1/repos/{repo}/releases/{release_id}/assets"
req = urllib.request.Request(url, headers={"Authorization": f"token {token}", "Accept": "application/json"})
req = urllib.request.Request(url, headers={"Authorization": get_auth_header(token), "Accept": "application/json"})
try:
with urllib.request.urlopen(req) as resp:
return json.loads(resp.read().decode("utf-8"))
@@ -24,7 +36,7 @@ def get_existing_assets(base_url, repo, release_id, token):
def delete_asset(base_url, repo, release_id, asset_id, token):
url = f"{base_url}/api/v1/repos/{repo}/releases/{release_id}/assets/{asset_id}"
req = urllib.request.Request(url, method="DELETE", headers={"Authorization": f"token {token}"})
req = urllib.request.Request(url, method="DELETE", headers={"Authorization": get_auth_header(token)})
try:
with urllib.request.urlopen(req) as resp:
pass
@@ -47,7 +59,7 @@ def upload_file_to_release(base_url, repo, release_id, token, file_path, max_ret
for attempt in range(1, max_retries + 1):
req = urllib.request.Request(url, data=file_bytes, method="POST")
req.add_header("Authorization", f"token {token}")
req.add_header("Authorization", get_auth_header(token))
req.add_header("Content-Type", "application/octet-stream")
req.add_header("Accept", "application/json")
@@ -73,14 +85,14 @@ def upload_file_to_release(base_url, repo, release_id, token, file_path, max_ret
def create_or_get_release(base_url, repo, tag, token, title=None, notes=None):
url = f"{base_url}/api/v1/repos/{repo}/releases"
headers = {
"Authorization": f"token {token}",
"Authorization": get_auth_header(token),
"Content-Type": "application/json",
"Accept": "application/json"
}
# Check if release exists
check_url = f"{base_url}/api/v1/repos/{repo}/releases/tags/{urllib.parse.quote(tag)}"
check_req = urllib.request.Request(check_url, headers={"Authorization": f"token {token}"})
check_req = urllib.request.Request(check_url, headers={"Authorization": get_auth_header(token)})
try:
with urllib.request.urlopen(check_req) as resp:
existing = json.loads(resp.read().decode("utf-8"))