release: artifact download: source from circleci

This commit is contained in:
Christian Schwarz
2026-02-15 18:32:47 +00:00
parent d7ee92f213
commit b1ea121d53
+9 -1
View File
@@ -7,13 +7,21 @@ import requests
import time import time
import os import os
import yaml
import argparse import argparse
from pathlib import Path from pathlib import Path
circle_token = os.environ.get('CIRCLE_TOKEN') circle_token = os.environ.get('CIRCLE_TOKEN')
if not circle_token: if not circle_token:
raise ValueError('CIRCLE_TOKEN environment variable not set') cli_yml = Path.home() / ".circleci" / "cli.yml"
if cli_yml.exists():
with open(cli_yml) as f:
data = yaml.safe_load(f)
if data:
circle_token = data.get("token")
if not circle_token:
raise ValueError('CIRCLE_TOKEN not set and no token found in ~/.circleci/cli.yml')
parser = argparse.ArgumentParser(description='Download artifacts from CircleCI') parser = argparse.ArgumentParser(description='Download artifacts from CircleCI')
parser.add_argument('build_num', type=str, help='Build number') parser.add_argument('build_num', type=str, help='Build number')