Publish to PyPI #7
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: Publish to PyPI | |
| on: | |
| workflow_dispatch: | |
| push: | |
| tags: | |
| - 'v*' | |
| permissions: | |
| contents: read | |
| jobs: | |
| build_wheels: | |
| name: Build wheels on ${{ matrix.os }} (${{ matrix.target }}) | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| include: | |
| # Linux x86_64 - use manylinux Docker (NOT zig) for SIMD support | |
| - os: ubuntu-latest | |
| target: x86_64-unknown-linux-gnu | |
| manylinux: "2_17" | |
| # Linux aarch64 | |
| - os: ubuntu-latest | |
| target: aarch64-unknown-linux-gnu | |
| manylinux: "2_17" | |
| # macOS ARM64 (Apple Silicon) | |
| - os: macos-14 | |
| target: aarch64-apple-darwin | |
| manylinux: null | |
| # macOS x86_64 (Intel) | |
| - os: macos-13 | |
| target: x86_64-apple-darwin | |
| manylinux: null | |
| # Windows x86_64 | |
| - os: windows-latest | |
| target: x86_64-pc-windows-msvc | |
| manylinux: null | |
| steps: | |
| - name: Checkout Repository | |
| uses: actions/checkout@v4 | |
| with: | |
| submodules: recursive | |
| - name: Set Up Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: "3.10" | |
| - name: Build wheels | |
| uses: PyO3/maturin-action@v1 | |
| with: | |
| target: ${{ matrix.target }} | |
| args: --release --out dist | |
| manylinux: ${{ matrix.manylinux == '2_17' && 'manylinux2014' || 'auto' }} | |
| working-directory: pyvq | |
| - name: Upload wheels as artifacts | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: wheels-${{ matrix.os }}-${{ matrix.target }} | |
| path: pyvq/dist/ | |
| publish_to_pypi: | |
| name: Publish to PyPI | |
| needs: build_wheels | |
| runs-on: ubuntu-latest | |
| if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/') | |
| steps: | |
| - name: Set Up Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: "3.10" | |
| - name: Install twine | |
| run: pip install twine | |
| - name: Download all wheels | |
| uses: actions/download-artifact@v4 | |
| with: | |
| path: wheels | |
| merge-multiple: true | |
| - name: Verify wheels | |
| run: | | |
| ls -la wheels/ | |
| twine check wheels/* | |
| # - name: Publish wheels to PyPI | |
| # run: | | |
| # twine upload wheels/* -u __token__ -p ${{ secrets.PYPI_API_TOKEN }} | |
| # if: success() |