Skip to content

Commit bfac267

Browse files
Filter wheel uploads based on tag
Only upload the package that matches the release tag to avoid uploading duplicate/unchanged packages and reduce PyPI errors. Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
1 parent f304f80 commit bfac267

File tree

1 file changed

+32
-0
lines changed

1 file changed

+32
-0
lines changed

.github/workflows/wheel-universal.yml

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,38 @@ jobs:
7878
name: distributions-universal
7979
path: ./dist
8080

81+
- name: Filter distributions based on tag
82+
if: startsWith(github.ref, 'refs/tags')
83+
run: |
84+
TAG="${{ github.ref_name }}"
85+
echo "Tag: $TAG"
86+
ls -la dist/
87+
88+
# Keep only the package matching the tag
89+
if [[ $TAG == viz-v* ]]; then
90+
find dist/ -type f ! -name 'vaex_viz-*' -delete
91+
elif [[ $TAG == hdf5-v* ]]; then
92+
find dist/ -type f ! -name 'vaex_hdf5-*' -delete
93+
elif [[ $TAG == server-v* ]]; then
94+
find dist/ -type f ! -name 'vaex_server-*' -delete
95+
elif [[ $TAG == astro-v* ]]; then
96+
find dist/ -type f ! -name 'vaex_astro-*' -delete
97+
elif [[ $TAG == jupyter-v* ]]; then
98+
find dist/ -type f ! -name 'vaex_jupyter-*' -delete
99+
elif [[ $TAG == ml-v* ]]; then
100+
find dist/ -type f ! -name 'vaex_ml-*' -delete
101+
elif [[ $TAG == graphql-v* ]]; then
102+
find dist/ -type f ! -name 'vaex_graphql-*' -delete
103+
elif [[ $TAG == contrib-v* ]]; then
104+
find dist/ -type f ! -name 'vaex_contrib-*' -delete
105+
elif [[ $TAG == v* ]]; then
106+
# Main vaex package (not vaex_*)
107+
find dist/ -type f ! -name 'vaex-*' -delete
108+
fi
109+
110+
echo "Filtered distributions:"
111+
ls -la dist/
112+
81113
# https://github.com/pypa/gh-action-pypi-publish#trusted-publishing
82114
- name: Publish package distributions to PyPI
83115
uses: pypa/gh-action-pypi-publish@v1.12.4

0 commit comments

Comments
 (0)