Skip to content

Commit

Permalink
Name kit artifacts
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
nedbat committed Dec 19, 2020
1 parent c377e65 commit f1dc6cc
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 7 deletions.
3 changes: 3 additions & 0 deletions .github/workflows/kit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ jobs:
- name: Upload wheels
uses: actions/upload-artifact@v2
with:
name: dist
path: ./wheelhouse/*.whl

build_sdist:
Expand All @@ -71,6 +72,7 @@ jobs:
- name: Upload sdist
uses: actions/upload-artifact@v2
with:
name: dist
path: dist/*.tar.gz

build_pypy:
Expand All @@ -97,4 +99,5 @@ jobs:
- name: Upload wheels
uses: actions/upload-artifact@v2
with:
name: dist
path: dist/*.whl
15 changes: 9 additions & 6 deletions ci/download_gha_artifacts.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
4 changes: 3 additions & 1 deletion howto.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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/*
Expand Down

0 comments on commit f1dc6cc

Please sign in to comment.