From f1dc6ccf94fafb7932a3c8d1a3e81dee2dcc808e Mon Sep 17 00:00:00 2001 From: Ned Batchelder Date: Sat, 19 Dec 2020 16:51:38 -0500 Subject: [PATCH] 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. --- .github/workflows/kit.yml | 3 +++ ci/download_gha_artifacts.py | 15 +++++++++------ howto.txt | 4 +++- 3 files changed, 15 insertions(+), 7 deletions(-) diff --git a/.github/workflows/kit.yml b/.github/workflows/kit.yml index bf57ec7d6..437e7d31b 100644 --- a/.github/workflows/kit.yml +++ b/.github/workflows/kit.yml @@ -50,6 +50,7 @@ jobs: - name: Upload wheels uses: actions/upload-artifact@v2 with: + name: dist path: ./wheelhouse/*.whl build_sdist: @@ -71,6 +72,7 @@ jobs: - name: Upload sdist uses: actions/upload-artifact@v2 with: + name: dist path: dist/*.tar.gz build_pypy: @@ -97,4 +99,5 @@ jobs: - name: Upload wheels uses: actions/upload-artifact@v2 with: + name: dist path: dist/*.whl diff --git a/ci/download_gha_artifacts.py b/ci/download_gha_artifacts.py index ac9d47907..5e86d2435 100644 --- a/ci/download_gha_artifacts.py +++ b/ci/download_gha_artifacts.py @@ -49,9 +49,12 @@ def utc2local(timestring): 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) diff --git a/howto.txt b/howto.txt index f0def3b43..8a912833d 100644 --- a/howto.txt +++ b/howto.txt @@ -44,8 +44,10 @@ - ELSE: $ make publish - Kits: + - Manually trigger the kit GitHub Action + - https://github.com/nedbat/coveragepy/actions?query=workflow%3A%22Build+kits%22 - Download built kits from GitHub Actions: - $ make download_kits + $ make clean download_kits - examine the dist directory, and remove anything that looks malformed. - check the dist directory: $ python -m twine check dist/*