Skip to content

Build python source distribution and wheels #1003

Build python source distribution and wheels

Build python source distribution and wheels #1003

Workflow file for this run

# 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 source distribution and wheels
on:
schedule:
- cron: '10 2 * * *'
push:
branches: [ '*' ]
pull_request:
branches: [ main ]
jobs:
build_source:
runs-on: ubuntu-latest
name: Build python source distribution
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Install python
uses: actions/setup-python@v2
with:
python-version: 3.11
- name: Get build dependencies
working-directory: ./dev
run: python -m pip install -r dev-requirements.txt
- name: Build source
run: python setup.py sdist
- name: Upload sources as artifacts
uses: actions/upload-artifact@v4
with:
name: source_package
path: ./dist/
build_wheels_linux:
name: Build python wheels on Linux
runs-on: ubuntu-20.04
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Install java
uses: actions/setup-java@v2
with:
java-version: '8'
distribution: 'adopt'
- name: Build wheel
run: bash dev/build-wheels.sh
- name: Upload wheels as artifacts
uses: actions/upload-artifact@v4
with:
name: wheel_ubuntu-20.04
path: ./dist/
build_wheels_mac:
name: Build python wheel for ${{ matrix.python }}-Mac
runs-on: ${{ matrix.buildplat[0] }}
strategy:
matrix:
buildplat:
- [macos-latest, macosx_*]
python: ["cp38", "cp39", "cp310", "cp311"]
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Install java
uses: actions/setup-java@v2
with:
java-version: '8'
distribution: 'adopt'
# Used to push the built wheels
- uses: actions/setup-python@v3
with:
python-version: '3.x'
- name: Build wheels
uses: pypa/[email protected]
env:
CIBW_BUILD: ${{ matrix.python }}-${{ matrix.buildplat[1] }}
- uses: actions/upload-artifact@v3
with:
name: ${{ matrix.python }}-${{ startsWith(matrix.buildplat[1], 'macosx') && 'macosx' || matrix.buildplat[1] }}
path: ./wheelhouse/*.whl