From d63a623763a0b07707c12819c8e0b83eebf23b0a Mon Sep 17 00:00:00 2001 From: Maximilian Eibl Date: Fri, 4 Sep 2026 15:56:24 +0200 Subject: [PATCH] Update compilation/upload_release.py to resolve paths relative to repo root --- compilation/upload_release.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/compilation/upload_release.py b/compilation/upload_release.py index d8550be..7535ad5 100644 --- a/compilation/upload_release.py +++ b/compilation/upload_release.py @@ -4,7 +4,8 @@ import json import argparse import urllib.request import urllib.parse -import mimetypes +ROOT_DIR = os.path.abspath(os.path.join(os.path.dirname(__file__), "..")) +sys.path.insert(0, os.path.dirname(__file__)) import package_dist import time @@ -162,8 +163,8 @@ def main(): if not notes and args.notes_file and os.path.exists(args.notes_file): with open(args.notes_file, "r", encoding="utf-8") as nf: notes = nf.read() - elif not notes and os.path.exists("RELEASE_NOTES.md"): - with open("RELEASE_NOTES.md", "r", encoding="utf-8") as nf: + elif not notes and os.path.exists(os.path.join(ROOT_DIR, "RELEASE_NOTES.md")): + with open(os.path.join(ROOT_DIR, "RELEASE_NOTES.md"), "r", encoding="utf-8") as nf: notes = nf.read() elif not notes: notes = ( @@ -184,9 +185,9 @@ def main(): print("[*] Assembling compiled binaries...") package_dist.main() - dist_dir = os.path.abspath("dist") + dist_dir = os.path.join(ROOT_DIR, "dist") if not os.path.exists(dist_dir) or not os.listdir(dist_dir): - print("[!] No binaries found in dist/. Run package_dist.py first.") + print(f"[!] No binaries found in {dist_dir}. Run package_dist.py first.") sys.exit(1) print(f"[*] Connecting to Gitea: {args.url} (repo: {args.repo})...")