upgrading packaging tools for twin [SKIP CI] #412
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 Default | |
| on: | |
| push: | |
| branches: | |
| - master | |
| tags: | |
| - '*' | |
| pull_request: | |
| branches: | |
| - master | |
| jobs: | |
| build_sdist: | |
| name: Build source | |
| runs-on: ubuntu-latest | |
| strategy: | |
| fail-fast: false | |
| steps: | |
| - uses: actions/checkout@master | |
| with: | |
| submodules: 'recursive' | |
| - name: Build source | |
| run: | | |
| python -m pip install build | |
| python -m build --sdist --outdir=wheelhouse | |
| - name: Upload sdist to github | |
| uses: actions/upload-artifact@v5 | |
| with: | |
| name: wheels-sdist | |
| path: wheelhouse/*.tar.gz | |
| if-no-files-found: error | |
| build_wheels: | |
| name: Build wheel on ${{ matrix.os }} for ${{ matrix.cibw_archs }} | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| include: | |
| - os: ubuntu-latest | |
| cibw_archs: "x86_64" | |
| - os: ubuntu-24.04-arm | |
| cibw_archs: "auto" | |
| - os: windows-2022 | |
| cibw_archs: "auto64" | |
| # Include macos-15-intel to get Intel x86_64 macs and macos-latest to get the Aaarch64 macs | |
| - os: macos-15-intel | |
| cibw_archs: "x86_64" | |
| - os: macos-latest | |
| cibw_archs: "arm64" | |
| steps: | |
| - uses: actions/checkout@master | |
| - name: Build wheels | |
| uses: pypa/cibuildwheel@v3.3.1 | |
| with: | |
| config-file: cibuildwheel.toml | |
| output-dir: wheelhouse | |
| env: | |
| CIBW_ENVIRONMENT_MACOS: CMAKE_OSX_ARCHITECTURES=${{ matrix.cibw_archs }} | |
| - name: Upload artifacts to github | |
| uses: actions/upload-artifact@v5 | |
| with: | |
| name: wheels-${{ runner.os }}-${{ matrix.cibw_archs }} | |
| path: ./wheelhouse/*.whl | |
| if-no-files-found: error | |
| publish_to_pypi: | |
| name: Publish wheels to PyPi | |
| if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags') | |
| needs: [build_sdist, build_wheels] | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Download packages | |
| uses: actions/download-artifact@v6 | |
| with: | |
| pattern: wheels-* | |
| path: dist | |
| merge-multiple: true | |
| - name: Print out packages | |
| run: ls -la dist/* | |
| - name: Upload wheels to pypi | |
| env: | |
| TWINE_USERNAME: __token__ | |
| TWINE_PASSWORD: ${{ secrets.pypi_password }} | |
| run: | | |
| python -m pip install --upgrade pip setuptools wheel packaging twine | |
| twine upload dist/* |