chore(release): bump version to 0.3.6.0-rc1 and support prerelease metadata
CI Test Suite / Run Component Tests & Pipeline Verification (push) Failing after 4m56s
Release Binaries & Packages / Build & Release Standalone Binaries (Linux & Windows Cross-Compilation) (push) Successful in 5m40s
Build and Push LOGAR Runner / Build & Push Runner Image (push) Successful in 11m54s
CI Test Suite / Run Component Tests & Pipeline Verification (push) Failing after 4m56s
Release Binaries & Packages / Build & Release Standalone Binaries (Linux & Windows Cross-Compilation) (push) Successful in 5m40s
Build and Push LOGAR Runner / Build & Push Runner Image (push) Successful in 11m54s
This commit is contained in:
@@ -82,7 +82,7 @@ def upload_file_to_release(base_url, repo, release_id, token, file_path, max_ret
|
||||
else:
|
||||
return None
|
||||
|
||||
def create_or_get_release(base_url, repo, tag, token, title=None, notes=None):
|
||||
def create_or_get_release(base_url, repo, tag, token, title=None, notes=None, prerelease=None):
|
||||
url = f"{base_url}/api/v1/repos/{repo}/releases"
|
||||
headers = {
|
||||
"Authorization": get_auth_header(token),
|
||||
@@ -90,6 +90,8 @@ def create_or_get_release(base_url, repo, tag, token, title=None, notes=None):
|
||||
"Accept": "application/json"
|
||||
}
|
||||
|
||||
is_prerelease = prerelease if prerelease is not None else any(x in tag.lower() for x in ["-rc", "-pre", "-beta", "-alpha", "preview"])
|
||||
|
||||
# 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": get_auth_header(token)})
|
||||
@@ -97,13 +99,15 @@ def create_or_get_release(base_url, repo, tag, token, title=None, notes=None):
|
||||
with urllib.request.urlopen(check_req) as resp:
|
||||
existing = json.loads(resp.read().decode("utf-8"))
|
||||
print(f"[*] Found existing release for tag {tag} (ID: {existing['id']})")
|
||||
if notes or title:
|
||||
if notes or title or (prerelease is not None):
|
||||
patch_url = f"{base_url}/api/v1/repos/{repo}/releases/{existing['id']}"
|
||||
patch_payload = {}
|
||||
if title:
|
||||
patch_payload["name"] = title
|
||||
if notes:
|
||||
patch_payload["body"] = notes
|
||||
if prerelease is not None:
|
||||
patch_payload["prerelease"] = is_prerelease
|
||||
patch_req = urllib.request.Request(
|
||||
patch_url,
|
||||
data=json.dumps(patch_payload).encode("utf-8"),
|
||||
@@ -125,7 +129,7 @@ def create_or_get_release(base_url, repo, tag, token, title=None, notes=None):
|
||||
"name": title or f"LOGAR Release {tag}",
|
||||
"body": notes or f"Automated binary release for {tag}.",
|
||||
"draft": False,
|
||||
"prerelease": False
|
||||
"prerelease": is_prerelease
|
||||
}
|
||||
req = urllib.request.Request(url, data=json.dumps(payload).encode("utf-8"), headers=headers, method="POST")
|
||||
try:
|
||||
|
||||
Reference in New Issue
Block a user