|
| 1 | +--- |
| 2 | +name: Wheel Builds New Setup |
| 3 | +on: |
| 4 | + push: |
| 5 | +jobs: |
| 6 | + rustworkx-core: |
| 7 | + name: Publish rustworkx-core |
| 8 | + runs-on: ubuntu-latest |
| 9 | + steps: |
| 10 | + - uses: actions/checkout@v4 |
| 11 | + - uses: dtolnay/rust-toolchain@stable |
| 12 | + - name: Run cargo publish |
| 13 | + run: | |
| 14 | + cd rustworkx-core |
| 15 | + cargo publish |
| 16 | + env: |
| 17 | + CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }} |
| 18 | + sdist: |
| 19 | + name: Build sdist |
| 20 | + runs-on: ubuntu-latest |
| 21 | + environment: release |
| 22 | + permissions: |
| 23 | + id-token: write |
| 24 | + needs: ["upload_shared_wheels"] |
| 25 | + steps: |
| 26 | + - uses: actions/checkout@v4 |
| 27 | + - uses: actions/setup-python@v5 |
| 28 | + name: Install Python |
| 29 | + with: |
| 30 | + python-version: '3.10' |
| 31 | + - name: Install deps |
| 32 | + run: pip install -U setuptools-rust |
| 33 | + - name: Build sdist |
| 34 | + run: python setup.py sdist |
| 35 | + - uses: actions/upload-artifact@v4 |
| 36 | + with: |
| 37 | + path: ./dist/* |
| 38 | + name: sdist-rustworkx |
| 39 | + - name: Publish package distributions to PyPI |
| 40 | + uses: pypa/gh-action-pypi-publish@release/v1 |
| 41 | + build_wheels: |
| 42 | + name: Build wheels on ${{ matrix.os }} |
| 43 | + runs-on: ${{ matrix.os }} |
| 44 | + environment: release |
| 45 | + strategy: |
| 46 | + fail-fast: false |
| 47 | + matrix: |
| 48 | + os: [ubuntu-latest, windows-latest, ubuntu-24.04-arm] |
| 49 | + steps: |
| 50 | + - uses: actions/checkout@v4 |
| 51 | + - uses: actions/setup-python@v5 |
| 52 | + name: Install Python |
| 53 | + with: |
| 54 | + python-version: '3.10' |
| 55 | + - uses: dtolnay/rust-toolchain@stable |
| 56 | + - name: Install cibuildwheel |
| 57 | + run: | |
| 58 | + python -m pip install cibuildwheel==2.21.3 |
| 59 | + - name: Build wheels |
| 60 | + run: | |
| 61 | + python -m cibuildwheel --output-dir wheelhouse |
| 62 | + - uses: actions/upload-artifact@v4 |
| 63 | + with: |
| 64 | + path: ./wheelhouse/*.whl |
| 65 | + name: shared-wheel-builds-${{ matrix.os }} |
| 66 | + upload_shared_wheels: |
| 67 | + name: Upload shared build wheels |
| 68 | + runs-on: ubuntu-latest |
| 69 | + environment: release |
| 70 | + permissions: |
| 71 | + id-token: write |
| 72 | + needs: ["build_wheels", "build-win32-wheels"] |
| 73 | + steps: |
| 74 | + - uses: actions/download-artifact@v4 |
| 75 | + with: |
| 76 | + pattern: shared-wheel-builds-* |
| 77 | + merge-multiple: true |
| 78 | + path: deploy |
| 79 | + - name: Publish package distributions to PyPI |
| 80 | + uses: pypa/gh-action-pypi-publish@release/v1 |
| 81 | + with: |
| 82 | + packages-dir: deploy |
| 83 | + build-win32-wheels: |
| 84 | + name: Build wheels on win32 |
| 85 | + runs-on: windows-latest |
| 86 | + environment: release |
| 87 | + steps: |
| 88 | + - uses: actions/checkout@v4 |
| 89 | + - uses: actions/setup-python@v5 |
| 90 | + name: Install Python |
| 91 | + with: |
| 92 | + python-version: '3.10' |
| 93 | + architecture: 'x86' |
| 94 | + - uses: dtolnay/rust-toolchain@stable |
| 95 | + with: |
| 96 | + targets: i686-pc-windows-msvc |
| 97 | + - name: Force win32 rust |
| 98 | + run: rustup default stable-i686-pc-windows-msvc |
| 99 | + - name: Install cibuildwheel |
| 100 | + run: | |
| 101 | + python -m pip install cibuildwheel==2.21.3 |
| 102 | + - name: Build wheels |
| 103 | + run: | |
| 104 | + python -m cibuildwheel --output-dir wheelhouse |
| 105 | + env: |
| 106 | + CIBW_SKIP: cp36-* cp37-* pp* *amd64 *musl* |
| 107 | + - uses: actions/upload-artifact@v4 |
| 108 | + with: |
| 109 | + path: ./wheelhouse/*.whl |
| 110 | + name: shared-wheel-builds-win32 |
| 111 | + retworkx-compat-build: |
| 112 | + name: Build retworkx |
| 113 | + runs-on: ubuntu-latest |
| 114 | + environment: release |
| 115 | + permissions: |
| 116 | + id-token: write |
| 117 | + needs: ["upload_shared_wheels"] |
| 118 | + steps: |
| 119 | + - uses: actions/checkout@v4 |
| 120 | + - uses: actions/setup-python@v5 |
| 121 | + name: Install Python |
| 122 | + with: |
| 123 | + python-version: '3.10' |
| 124 | + - name: Install deps |
| 125 | + run: pip install -U setuptools-rust wheel build |
| 126 | + - name: Build sdist |
| 127 | + run: pushd retworkx && python setup.py bdist_wheel && popd |
| 128 | + - uses: actions/upload-artifact@v4 |
| 129 | + with: |
| 130 | + path: ./retworkx/dist/* |
| 131 | + name: sdist-retworkx |
| 132 | + - name: Publish package distributions to PyPI |
| 133 | + uses: pypa/gh-action-pypi-publish@release/v1 |
0 commit comments