From f1dc6ccf94fafb7932a3c8d1a3e81dee2dcc808e Mon Sep 17 00:00:00 2001 From: Ned Batchelder Date: Sat, 19 Dec 2020 16:51:38 -0500 Subject: Name kit artifacts Without a name, the download program will grab the latest artifacts no matter what they are, like .coverage data files from metacov. This ensures we get the kits. --- ci/download_gha_artifacts.py | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) (limited to 'ci') diff --git a/ci/download_gha_artifacts.py b/ci/download_gha_artifacts.py index ac9d4790..5e86d243 100644 --- a/ci/download_gha_artifacts.py +++ b/ci/download_gha_artifacts.py @@ -49,9 +49,12 @@ if not os.path.exists(dest): os.chdir(dest) r = requests.get(f"https://api.github.com/repos/{repo_owner}/actions/artifacts") -latest = max(r.json()["artifacts"], key=lambda a: a["created_at"]) - -print(f"Artifacts created at {utc2local(latest['created_at'])}") -download_url(latest["archive_download_url"], temp_zip) -unpack_zipfile(temp_zip) -os.remove(temp_zip) +dists = [a for a in r.json()["artifacts"] if a["name"] == "dist"] +if not dists: + print(f"No recent dists!") +else: + latest = max(dists, key=lambda a: a["created_at"]) + print(f"Artifacts created at {utc2local(latest['created_at'])}") + download_url(latest["archive_download_url"], temp_zip) + unpack_zipfile(temp_zip) + os.remove(temp_zip) -- cgit v1.2.1