Refactor publish workflow for PyPI

This commit is contained in:
BillTheMaker
2025-12-06 19:30:14 -07:00
committed by GitHub
parent 000a2fad3a
commit f9ecbae6a4

View File

@@ -48,31 +48,31 @@ jobs:
name: wheels-${{ matrix.os }}-${{ matrix.target }} name: wheels-${{ matrix.os }}-${{ matrix.target }}
path: dist path: dist
publish: publish:
name: Publish to PyPI name: Publish to PyPI
needs: [build_wheels] needs: [build_wheels]
runs-on: ubuntu-latest runs-on: ubuntu-latest
if: startsWith(github.ref, 'refs/tags/') || github.event_name == 'workflow_dispatch' # REMOVED problematic if condition
steps: steps:
- name: Install maturin for upload - name: Install maturin for upload
run: pip install maturin run: pip install maturin
- name: Download ALL wheels - name: Download ALL wheels
uses: actions/download-artifact@v4 uses: actions/download-artifact@v4
with: with:
path: dist path: dist
- name: Flatten wheels to dist/ - name: Flatten wheels to dist/
run: | run: |
find dist -name "*.whl" -exec cp {} dist/ \; find dist -name "*.whl" -exec cp {} dist/ \;
echo "Wheels ready:" echo "Wheels ready:"
ls -la dist/*.whl ls -la dist/*.whl
- name: Publish to PyPI - name: Publish to PyPI
env: env:
PYPI_TOKEN: ${{ secrets.PYPI_API_TOKEN }} # ← FIXED: env var PYPI_TOKEN: ${{ secrets.PYPI_API_TOKEN }}
run: | run: |
cd dist cd dist
ls -la *.whl ls -la *.whl
maturin upload --skip-existing --non-interactive # ← No --token maturin upload --skip-existing --non-interactive