Fix wheel platform tag for PyPI upload #2
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Build and publish to PyPI | |
| on: | |
| push: | |
| tags: | |
| - "v*" | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| strategy: | |
| matrix: | |
| python-version: ["3.10", "3.11", "3.12", "3.13"] | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-python@v5 | |
| with: | |
| python-version: ${{ matrix.python-version }} | |
| - name: Install build deps | |
| run: pip install build cython auditwheel patchelf | |
| - name: Copy engine source | |
| env: | |
| ENGINE_SOURCE: ${{ secrets.ENGINE_SOURCE }} | |
| run: echo "$ENGINE_SOURCE" > archview/_engine.py | |
| - name: Build wheel | |
| run: python -m build --wheel | |
| - name: Fix wheel platform tag | |
| run: | | |
| auditwheel repair dist/*.whl --plat manylinux_2_35_x86_64 -w dist-fixed/ | |
| rm -rf dist | |
| mv dist-fixed dist | |
| - uses: actions/upload-artifact@v4 | |
| with: | |
| name: wheel-${{ matrix.python-version }} | |
| path: dist/*.whl | |
| publish: | |
| needs: build | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/download-artifact@v4 | |
| with: | |
| path: dist | |
| merge-multiple: true | |
| - uses: actions/setup-python@v5 | |
| with: | |
| python-version: "3.12" | |
| - name: Publish to PyPI | |
| run: | | |
| pip install twine | |
| twine upload dist/*.whl | |
| env: | |
| TWINE_USERNAME: __token__ | |
| TWINE_PASSWORD: ${{ secrets.PYPI_TOKEN }} |