Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 21 additions & 1 deletion .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,25 @@ jobs:
- name: Run tests
run: pytest

# Start from an empty dist/ so only this release's files can be uploaded
- name: Build sdist and wheel
run: python -m build
run: |
rm -rf dist
python -m build

- name: Check only this version was built
env:
TAG: ${{ github.event.release.tag_name }}
run: |
VERSION="${TAG#v}"
ls -l dist/
if [ "$(ls dist | wc -l)" -ne 2 ] \
|| [ ! -f "dist/gene_fetch-${VERSION}.tar.gz" ] \
|| [ ! -f "dist/gene_fetch-${VERSION}-py3-none-any.whl" ]; then
echo "::error::dist/ must contain exactly gene_fetch-${VERSION}.tar.gz and gene_fetch-${VERSION}-py3-none-any.whl"
exit 1
fi
echo "✓ dist/ contains only version ${VERSION}"

- name: Check distribution metadata
run: twine check --strict dist/*
Expand Down Expand Up @@ -80,3 +97,6 @@ jobs:

- name: Publish to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
# Skip files already on PyPI, so a partly-failed release can be re-run
skip-existing: true
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
dist/
__pycache__/
*.egg-info/
.venv/
Binary file removed dist/gene_fetch-1.0.16-py3-none-any.whl
Binary file not shown.
Binary file removed dist/gene_fetch-1.0.16.tar.gz
Binary file not shown.
Binary file removed dist/gene_fetch-1.0.17-py3-none-any.whl
Binary file not shown.
Binary file removed dist/gene_fetch-1.0.17.tar.gz
Binary file not shown.
Binary file removed dist/gene_fetch-1.0.18-py3-none-any.whl
Binary file not shown.
Binary file removed dist/gene_fetch-1.0.18.tar.gz
Binary file not shown.
Binary file removed dist/gene_fetch-1.0.19-py3-none-any.whl
Binary file not shown.
Binary file removed dist/gene_fetch-1.0.19.tar.gz
Binary file not shown.
Binary file removed dist/gene_fetch-1.0.20-py3-none-any.whl
Binary file not shown.
Binary file removed dist/gene_fetch-1.0.20.tar.gz
Binary file not shown.
Loading