yangxk1 commented on code in PR #813: URL: https://github.com/apache/incubator-graphar/pull/813#discussion_r2646766243
########## .github/workflows/python-wheel-workflow.yml: ########## @@ -0,0 +1,282 @@ + +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + +name: Build Python Wheels + +on: + # Trigger the workflow on push or pull request, + # but only for the main branch + push: + branches: + - "main" + paths: + - 'cpp/**' + - 'python/**' + - '.github/workflows/python-wheel-workflow.yml' + - '.github/scripts/update_version.py' + pull_request: + branches: + - "main" + paths: + - 'cpp/**' + - 'python/**' + - '.github/workflows/ci.yml' + - '.github/workflows/python.yml' + workflow_dispatch: + inputs: + publish_pypi: + description: "Publish to PyPI (manual runs only)" + required: true + default: false + type: boolean + +jobs: + build_sdist: + name: Build source distribution + runs-on: ubuntu-22.04 + steps: + - uses: actions/checkout@v3 + + - name: Set up Python + uses: actions/setup-python@v4 + with: + python-version: "3.9" + + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install build twine + - name: update pyporject version + if: github.event_name != 'workflow_dispatch' || !inputs.publish_pypi + run: | + python .github/scripts/update_version.py + - name: Build sdist + run: | + # Bundle C++ sources into python/ so the sdist contains them. + rm -rf python/_bundled_cpp + cp -a cpp python/_bundled_cpp + cd python + python -m build --sdist + - name: Store artifacts + uses: actions/upload-artifact@v4 + with: + name: sdist + path: python/dist/* + + build_wheels: + name: Build wheels on ${{ matrix.runner }} + runs-on: ${{ matrix.runner }} + needs: build_sdist + strategy: + matrix: + include: + # Job 1: Native x86_64 build + - platform: x86_64 + runner: ubuntu-latest # This is the standard x86_64 runner + os: linux + manylinux: _2_28 + deployment-target: '' + + # Job 2: Native aarch64 build + - platform: aarch64 + runner: ubuntu-22.04-arm # This is a native ARM64 runner + os: linux + manylinux: _2_28 + deployment-target: '' + + # Job 3: macOS arm64 build + - platform: arm64 + runner: macos-latest + os: macos + deployment-target: '11.0' + + + env: + CIBW_PLATFORM: ${{ matrix.os }} + CIBW_BUILD: "cp310-* cp311-* cp312-* cp313-*" + CIBW_SKIP: "*-musllinux_*" + # Pin arch to the matrix platform + CIBW_ARCHS: ${{ (matrix.os == 'linux' && matrix.platform) || (matrix.os == 'macos' && matrix.platform) || (matrix.os == 'windows' && 'AMD64') || 'auto' }} Review Comment: ignore, Window will be added later -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
