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})...")