|
| 1 | +name: release |
| 2 | + |
| 3 | +on: |
| 4 | + release: |
| 5 | + types: [ published ] |
| 6 | + |
| 7 | +concurrency: |
| 8 | + group: ${{ github.workflow }}-${{ github.ref }} |
| 9 | + cancel-in-progress: true |
| 10 | + |
| 11 | +env: |
| 12 | + PYTHON_VERSION: "3.11" |
| 13 | + CIBW_VERSION: "2.23.3" |
| 14 | + |
| 15 | +jobs: |
| 16 | + build-wheels: |
| 17 | + name: Build wheels on ${{ matrix.os }} |
| 18 | + runs-on: ${{ matrix.os }} |
| 19 | + strategy: |
| 20 | + matrix: |
| 21 | + os: [ ubuntu-24.04 ] |
| 22 | + steps: |
| 23 | + - name: Checkout |
| 24 | + uses: actions/checkout@v4 |
| 25 | + - name: Set up Python |
| 26 | + uses: actions/setup-python@v5 |
| 27 | + with: |
| 28 | + python-version: ${{ env.PYTHON_VERSION }} |
| 29 | + - name: Install cibuildwheel |
| 30 | + run: python -m pip install cibuildwheel==${{ env.CIBW_VERSION }} |
| 31 | + - name: Build wheels |
| 32 | + run: python -m cibuildwheel --output-dir wheelhouse |
| 33 | + - name: Upload artifacts |
| 34 | + uses: actions/upload-artifact@v4 |
| 35 | + with: |
| 36 | + name: cibw-wheels-${{ matrix.os }}-${{ strategy.job-index }} |
| 37 | + path: ./wheelhouse/*.whl |
| 38 | + retention-days: 1 |
| 39 | + |
| 40 | + publish-github-releases: |
| 41 | + runs-on: ubuntu-24.04 |
| 42 | + needs: [ build-wheels ] |
| 43 | + steps: |
| 44 | + - name: Download artifacts |
| 45 | + uses: actions/download-artifact@v4 |
| 46 | + with: |
| 47 | + pattern: cibw-wheels-* |
| 48 | + path: ./wheelhouse |
| 49 | + merge-multiple: true |
| 50 | + - name: Publish packages to GitHub Releases |
| 51 | + uses: softprops/action-gh-release@v2 |
| 52 | + with: |
| 53 | + files: ./wheelhouse/* |
| 54 | + |
| 55 | + publish-pypi: |
| 56 | + runs-on: ubuntu-24.04 |
| 57 | + needs: [ build-wheels ] |
| 58 | + steps: |
| 59 | + - name: Download artifacts |
| 60 | + uses: actions/download-artifact@v4 |
| 61 | + with: |
| 62 | + pattern: cibw-wheels-* |
| 63 | + path: ./wheelhouse/ |
| 64 | + merge-multiple: true |
| 65 | + - name: Publish package to PyPI |
| 66 | + uses: pypa/gh-action-pypi-publish@release/v1 |
| 67 | + with: |
| 68 | + packages-dir: ./wheelhouse/ |
| 69 | + password: ${{ secrets.PYPI_PASSWORD_GEOMDL }} |
0 commit comments