Fix MANIFEST.in to point to new cython path #105
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 | |
| on: | |
| pull_request: | |
| types: [opened, synchronize, reopened, labeled] | |
| push: | |
| branches: [deploy] | |
| tags: ["*"] | |
| workflow_dispatch: | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref }} | |
| cancel-in-progress: true | |
| jobs: | |
| check_approval: | |
| runs-on: ubuntu-latest | |
| outputs: | |
| should_build: ${{ steps.check.outputs.should_build }} | |
| steps: | |
| - name: Check if build should run | |
| id: check | |
| run: | | |
| if [[ "${{ github.event_name }}" == "push" ]]; then | |
| # Always build on push to deploy branch or tags | |
| echo "should_build=true" >> $GITHUB_OUTPUT | |
| elif [[ "${{ github.event_name }}" == "workflow_dispatch" ]]; then | |
| # Always build on manual trigger | |
| echo "should_build=true" >> $GITHUB_OUTPUT | |
| elif [[ "${{ github.event_name }}" == "pull_request" ]]; then | |
| # Check for approval label on PRs | |
| if [[ "${{ contains(github.event.pull_request.labels.*.name, 'build-approved') }}" == "true" ]]; then | |
| echo "should_build=true" >> $GITHUB_OUTPUT | |
| else | |
| echo "should_build=false" >> $GITHUB_OUTPUT | |
| fi | |
| else | |
| echo "should_build=false" >> $GITHUB_OUTPUT | |
| fi | |
| build_wheels: | |
| name: Build wheel for ${{ matrix.os }}-${{ matrix.build }}${{ matrix.python }}-${{ matrix.arch }} | |
| runs-on: ${{ matrix.os }} | |
| needs: check_approval | |
| if: needs.check_approval.outputs.should_build == 'true' | |
| strategy: | |
| # Ensure that a wheel builder finishes even if another fails | |
| fail-fast: false | |
| matrix: | |
| os: [windows-latest, ubuntu-latest, ubuntu-24.04-arm, macos-latest] | |
| python: [310, 311, 312, 313, 314] | |
| arch: [auto64, universal2] | |
| build: ["cp"] | |
| exclude: | |
| - os: ubuntu-latest | |
| arch: universal2 | |
| - os: ubuntu-24.04-arm | |
| arch: universal2 | |
| - os: windows-latest | |
| arch: universal2 | |
| steps: | |
| - uses: actions/checkout@v5 | |
| - uses: astral-sh/setup-uv@v7 | |
| - uses: pypa/cibuildwheel@v3.2 | |
| env: | |
| CIBW_BUILD_FRONTEND: "build[uv]" | |
| CIBW_BUILD: "${{ matrix.build }}${{ matrix.python }}*" | |
| CIBW_SKIP: "*t-*" | |
| CIBW_ARCHS: ${{ matrix.arch }} | |
| CIBW_TEST_COMMAND: > | |
| uv run python -c "import sys; import pymoo; print(pymoo); from pymoo.functions import is_compiled; sys.exit(0 if is_compiled() else 42)" | |
| - uses: actions/upload-artifact@v4 | |
| with: | |
| name: "artifact-${{ matrix.os }}-${{ matrix.build }}-${{ matrix.python }}-${{ matrix.arch }}" | |
| path: ./wheelhouse/*.whl | |
| build_sdist: | |
| name: Build source distribution | |
| runs-on: ubuntu-latest | |
| needs: check_approval | |
| if: needs.check_approval.outputs.should_build == 'true' | |
| steps: | |
| - uses: actions/checkout@v5 | |
| - uses: astral-sh/setup-uv@v7 | |
| - run: uv build --sdist | |
| - uses: actions/upload-artifact@v4 | |
| with: | |
| name: artifact-source | |
| path: dist/*.tar.gz | |
| merge: | |
| name: Merge sdist and wheel artifacts | |
| needs: [build_wheels, build_sdist] | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/upload-artifact/merge@v4 | |
| with: | |
| name: pymoo | |
| delete-merged: true | |