Skip to content

Commit 4d28402

Browse files
committed
do not upload non-distribution files to PyPI; delete possible already existing release for github releases
1 parent 4a4469c commit 4d28402

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

.github/workflows/release.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -188,6 +188,9 @@ jobs:
188188
# Generate release tag based on timestamp and commit
189189
RELEASE_TAG="wheels-$(date +'%Y%m%d')-${{ github.sha }}"
190190
191+
# Delete existing release if it exists (ignore errors)
192+
gh release delete "$RELEASE_TAG" --repo "$GITHUB_REPOSITORY" --yes || true
193+
191194
# Create release
192195
gh release create "$RELEASE_TAG" \
193196
--repo "$GITHUB_REPOSITORY" \
@@ -270,6 +273,11 @@ jobs:
270273
echo "Wheel count: $(ls dist/*.whl | wc -l)"
271274
echo "Source distributions: $(ls dist/*.tar.gz | wc -l)"
272275
276+
- name: Remove non-distribution files
277+
run: |
278+
# Remove build metadata files that shouldn't go to PyPI
279+
rm -f dist/build-info.txt dist/*-docs.tar.gz
280+
273281
- name: Publish package to PyPI
274282
uses: pypa/gh-action-pypi-publish@release/v1
275283
with:

0 commit comments

Comments
 (0)