Skip to content

Commit f1dc6cc

Browse files
committed
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.
1 parent c377e65 commit f1dc6cc

File tree

3 files changed

+15
-7
lines changed

3 files changed

+15
-7
lines changed

.github/workflows/kit.yml

+3
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ jobs:
5050
- name: Upload wheels
5151
uses: actions/upload-artifact@v2
5252
with:
53+
name: dist
5354
path: ./wheelhouse/*.whl
5455

5556
build_sdist:
@@ -71,6 +72,7 @@ jobs:
7172
- name: Upload sdist
7273
uses: actions/upload-artifact@v2
7374
with:
75+
name: dist
7476
path: dist/*.tar.gz
7577

7678
build_pypy:
@@ -97,4 +99,5 @@ jobs:
9799
- name: Upload wheels
98100
uses: actions/upload-artifact@v2
99101
with:
102+
name: dist
100103
path: dist/*.whl

ci/download_gha_artifacts.py

+9-6
Original file line numberDiff line numberDiff line change
@@ -49,9 +49,12 @@ def utc2local(timestring):
4949
os.chdir(dest)
5050

5151
r = requests.get(f"https://api.github.com/repos/{repo_owner}/actions/artifacts")
52-
latest = max(r.json()["artifacts"], key=lambda a: a["created_at"])
53-
54-
print(f"Artifacts created at {utc2local(latest['created_at'])}")
55-
download_url(latest["archive_download_url"], temp_zip)
56-
unpack_zipfile(temp_zip)
57-
os.remove(temp_zip)
52+
dists = [a for a in r.json()["artifacts"] if a["name"] == "dist"]
53+
if not dists:
54+
print(f"No recent dists!")
55+
else:
56+
latest = max(dists, key=lambda a: a["created_at"])
57+
print(f"Artifacts created at {utc2local(latest['created_at'])}")
58+
download_url(latest["archive_download_url"], temp_zip)
59+
unpack_zipfile(temp_zip)
60+
os.remove(temp_zip)

howto.txt

+3-1
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,10 @@
4444
- ELSE:
4545
$ make publish
4646
- Kits:
47+
- Manually trigger the kit GitHub Action
48+
- https://github.com/nedbat/coveragepy/actions?query=workflow%3A%22Build+kits%22
4749
- Download built kits from GitHub Actions:
48-
$ make download_kits
50+
$ make clean download_kits
4951
- examine the dist directory, and remove anything that looks malformed.
5052
- check the dist directory:
5153
$ python -m twine check dist/*

0 commit comments

Comments
 (0)