Update compilation/upload_release.py to resolve paths relative to repo root
This commit is contained in:
@@ -4,7 +4,8 @@ import json
|
|||||||
import argparse
|
import argparse
|
||||||
import urllib.request
|
import urllib.request
|
||||||
import urllib.parse
|
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 package_dist
|
||||||
|
|
||||||
import time
|
import time
|
||||||
@@ -162,8 +163,8 @@ def main():
|
|||||||
if not notes and args.notes_file and os.path.exists(args.notes_file):
|
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:
|
with open(args.notes_file, "r", encoding="utf-8") as nf:
|
||||||
notes = nf.read()
|
notes = nf.read()
|
||||||
elif not notes and os.path.exists("RELEASE_NOTES.md"):
|
elif not notes and os.path.exists(os.path.join(ROOT_DIR, "RELEASE_NOTES.md")):
|
||||||
with open("RELEASE_NOTES.md", "r", encoding="utf-8") as nf:
|
with open(os.path.join(ROOT_DIR, "RELEASE_NOTES.md"), "r", encoding="utf-8") as nf:
|
||||||
notes = nf.read()
|
notes = nf.read()
|
||||||
elif not notes:
|
elif not notes:
|
||||||
notes = (
|
notes = (
|
||||||
@@ -184,9 +185,9 @@ def main():
|
|||||||
print("[*] Assembling compiled binaries...")
|
print("[*] Assembling compiled binaries...")
|
||||||
package_dist.main()
|
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):
|
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)
|
sys.exit(1)
|
||||||
|
|
||||||
print(f"[*] Connecting to Gitea: {args.url} (repo: {args.repo})...")
|
print(f"[*] Connecting to Gitea: {args.url} (repo: {args.repo})...")
|
||||||
|
|||||||
Reference in New Issue
Block a user