|
| 1 | +name: Publish Xdeps to PyPI |
| 2 | + |
| 3 | +on: |
| 4 | + release: |
| 5 | + types: [released, edited] |
| 6 | + |
| 7 | +jobs: |
| 8 | + build-wheels: |
| 9 | + name: Build wheels for ${{ matrix.os }} |
| 10 | + runs-on: ${{ matrix.os }} |
| 11 | + strategy: |
| 12 | + matrix: |
| 13 | + os: [ubuntu-latest, macos-13, macos-14] |
| 14 | + |
| 15 | + steps: |
| 16 | + - uses: actions/checkout@v4 |
| 17 | + |
| 18 | + - uses: actions/setup-python@v3 |
| 19 | + |
| 20 | + - name: Install cibuildwheel |
| 21 | + run: python -m pip install cibuildwheel==2.16.5 |
| 22 | + |
| 23 | + - name: Build wheels |
| 24 | + run: python -m cibuildwheel --output-dir wheelhouse |
| 25 | + env: |
| 26 | + CIBW_PROJECT_REQUIRES_PYTHON: ">=3.7" |
| 27 | + |
| 28 | + - uses: actions/upload-artifact@v4 |
| 29 | + with: |
| 30 | + name: dist-wheels-${{ matrix.os }}-${{ strategy.job-index }} |
| 31 | + path: ./wheelhouse/*.whl |
| 32 | + |
| 33 | + build-sdist: |
| 34 | + name: Build source distribution |
| 35 | + runs-on: ubuntu-latest |
| 36 | + steps: |
| 37 | + - uses: actions/checkout@v4 |
| 38 | + |
| 39 | + - name: Build sdist |
| 40 | + run: pipx run build --sdist |
| 41 | + |
| 42 | + - uses: actions/upload-artifact@v4 |
| 43 | + with: |
| 44 | + name: dist-sdist |
| 45 | + path: dist/*.tar.gz |
| 46 | + |
| 47 | + publish-to-pypi: |
| 48 | + name: Publish Xdeps to PyPI |
| 49 | + runs-on: ubuntu-latest |
| 50 | + needs: [build-wheels, build-sdist] |
| 51 | + environment: |
| 52 | + name: pypi |
| 53 | + url: https://pypi.org/p/xdeps |
| 54 | + permissions: |
| 55 | + id-token: write |
| 56 | + |
| 57 | + steps: |
| 58 | + - name: Download all the dists |
| 59 | + uses: actions/download-artifact@v4 |
| 60 | + with: |
| 61 | + pattern: dist-* |
| 62 | + path: dist |
| 63 | + merge-multiple: true |
| 64 | + |
| 65 | + - name: Publish to PyPI |
| 66 | + uses: pypa/gh-action-pypi-publish@release/v1 |
0 commit comments