Update wheels.yml: add sdist to package #137
Workflow file for this run
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 wheels | ||
| # on: [push, pull_request] | ||
| on: workflow_dispatch | ||
| jobs: | ||
| ###################### | ||
| # Job: Build sdist | ||
| ###################### | ||
| build-sdist: | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - name: Checkout self | ||
| uses: actions/checkout@v8 | ||
| - name: Checkout ughub | ||
| run: | | ||
| git clone https://github.com/UG4/ughub.git | ||
| - name: Install UG4 packages | ||
| run: | | ||
| python3 ughub/ughub.py init | ||
| python3 ughub/ughub.py install ugcore | ||
| python3 ughub/ughub.py install ConvectionDiffusion Limex SuperLU6 Util | ||
| python3 ughub/ughub.py install PybindForUG4 | ||
| python3 ughub/ughub.py git submodule init | ||
| python3 ughub/ughub.py git submodule update | ||
| - name: Switch to Pybind feature branch(es), if any. | ||
| run: python3 ughub/ughub.py git checkout feature-pybind11 | ||
| continue-on-error: true | ||
| - name: Install Python | ||
| run: | | ||
| pip3 install build | ||
| python3 -m build --sdist | ||
| - uses: actions/upload-artifact@v8 | ||
| with: | ||
| name: sdist | ||
| path: dist/*.tar.gz | ||
| ###################### | ||
| # Job: Build wheel | ||
| ###################### | ||
| build-wheels: | ||
| needs: build-sdist | ||
| name: Build wheels on ${{ matrix.os }} | ||
| runs-on: ${{ matrix.os }} | ||
| strategy: | ||
| matrix: | ||
| #os: [macos-15-intel, macos-latest, ubuntu-latest, windows-latest] # 12 oldest | ||
| #os: [macos-15-intel, macos-latest, ubuntu-latest] # 12 oldest | ||
| os: [] | ||
| steps: | ||
| ## Used to host cibuildwheel | ||
| # - uses: actions/setup-python@v5 | ||
| - name: Checkout self | ||
| uses: actions/checkout@v8 | ||
| - name: Download sdist. | ||
| uses: actions/download-artifact@v8 | ||
| with: | ||
| name: sdist | ||
| path: dist | ||
| # We would need MPI in CIBW - no here... | ||
| # - name: Checkout MPI. | ||
| # uses: mpi4py/setup-mpi@v1 | ||
| - name: Build wheels. | ||
| uses: pypa/cibuildwheel@v3.4.0 | ||
| env: | ||
| CIBW_BUILD_VERBOSITY: 1 | ||
| # CIBW_REPAIR_WHEEL_COMMAND: '' | ||
| # CIBW_BUILD: cp311-* | ||
| CIBW_BUILD: cp312-* cp314-* | ||
| # Skip builds for 32-bit builds and some others... | ||
| CIBW_SKIP: "*-win32 *-musllinux_* *linux_i686 *linux_s390x *linux_aarch64 *linux_s390x" | ||
| # Environment variables. | ||
| # CIBW_ENVIRONMENT: CFLAGS='-fPIC -fvisibility=hidden' CXXFLAGS='-fPIC -fvisibility=hidden' | ||
| # Set flags on linux | ||
| # CIBW_ENVIRONMENT_LINUX: | ||
| # CIBW_ENVIRONMENT_WINDOWS: | ||
| # Only on Linux, we must forward environment variables explitly. | ||
| # CIBW_ENVIRONMENT_PASS_LINUX: CFLAGS CXXFLAGS | ||
| with: | ||
| package-dir: dist/ug4py_base-0.2.3.tar.gz | ||
| output-dir: wheelhouse | ||
| # config-file: "pyproject.toml" | ||
| config-file: "{package}/pyproject.toml" | ||
| - uses: actions/upload-artifact@v8 | ||
| with: | ||
| name: ug4py-basic-wheels-${{ matrix.os }}-${{ strategy.job-index }} | ||
| path: ./wheelhouse/*.whl | ||
| ######################## | ||
| # Job: Publish to PyPI | ||
| ######################## | ||
| pypi-publish: | ||
| name: Upload release to PyPI | ||
| # if: startsWith(github.ref, 'refs/tags/') # only publish to PyPI on tag pushes | ||
| needs: | ||
| - build-wheels | ||
| runs-on: ubuntu-latest | ||
| # Specifying a GitHub environment is optional, but strongly encouraged | ||
| environment: release | ||
| permissions: | ||
| # IMPORTANT: this permission is mandatory for trusted publishing | ||
| id-token: write | ||
| steps: | ||
| # retrieve your distributions here | ||
| - name: Download sdist. | ||
| uses: actions/download-artifact@v8 | ||
| with: | ||
| name: sdist | ||
| path: dist/ | ||
| - name: Download wheels. | ||
| uses: actions/download-artifact@v8 | ||
| with: | ||
| pattern: ug4py-basic-wheels-* | ||
| merge-multiple: true | ||
| path: dist/ | ||
| - run: ls -R dist | ||
| - name: Publish distribution 📦 to PyPI | ||
| uses: pypa/gh-action-pypi-publish@release/v1 | ||