Skip to content

Commit

Permalink
Build all supported python versions by default, allow option to override
Browse files Browse the repository at this point in the history
  • Loading branch information
juliannguyen4 committed May 30, 2024
1 parent e78b5e2 commit 07ef496
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 35 deletions.
14 changes: 10 additions & 4 deletions .github/workflows/build-and-upload-wheels-for-qe.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,17 @@ on:

jobs:
build-artifacts:
uses: ./.github/workflows/build-wheels.yml
strategy:
matrix:
platform-tag: [
"manylinux_x86_64",
"manylinux_aarch64"
]
uses: ./.github/workflows/cibuildwheel.yml
with:
# In a push event, any input values default to ''
# https://github.com/orgs/community/discussions/29242#discussioncomment-5063461
apply-no-optimizations: ${{ github.event_name == 'workflow_dispatch' && inputs.disable-optimizations || false }}
platform-tags: ${{ matrix.platform-tag }}
os: ubuntu-22.04
unoptimized: ${{ github.event_name == 'workflow_dispatch' && inputs.disable-optimizations || false }}

upload-to-jfrog:
needs: build-artifacts
Expand Down
28 changes: 0 additions & 28 deletions .github/workflows/build-wheels.yml
Original file line number Diff line number Diff line change
Expand Up @@ -134,52 +134,24 @@ jobs:
["manylinux_aarch64", "ubuntu-22.04"],
["macosx_x86_64", "macos-12-large"]
]
python-tag: [
"cp38",
"cp39",
"cp310",
"cp311",
"cp312"
]
uses: ./.github/workflows/cibuildwheel.yml
with:
python-tag: ${{ matrix.python-tag }}
platform-tags: ${{ matrix.platform-tag-and-os[0] }}
os: ${{ matrix.platform-tag-and-os[1] }}
unoptimized: ${{ inputs.apply-no-optimizations }}
include-debug-info-for-macos: ${{ inputs.include-debug-info-for-macos }}

build-macOS-m1:
strategy:
matrix:
python-tag: [
"cp38",
"cp39",
"cp310",
"cp311",
"cp312"
]
uses: ./.github/workflows/cibuildwheel.yml
with:
python-tag: ${{ matrix.python-tag }}
platform-tags: macosx_arm64
os: macos-13-xlarge
unoptimized: ${{ inputs.apply-no-optimizations }}
include-debug-info-for-macos: ${{ inputs.include-debug-info-for-macos }}

build-windows:
strategy:
matrix:
python-tag: [
"cp38",
"cp39",
"cp310",
"cp311",
"cp312"
]
uses: ./.github/workflows/cibuildwheel.yml
with:
python-tag: ${{ matrix.python-tag }}
platform-tags: win_amd64
os: windows-2022

Expand Down
10 changes: 7 additions & 3 deletions .github/workflows/cibuildwheel.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,10 @@ name: 'Build wheels using cibuildwheel'
on:
workflow_call:
inputs:
python-tag:
python-tags:
type: string
required: true
default: '["cp38", "cp39", "cp310", "cp311", "cp312"]'
platform-tag:
type: string
required: true
Expand All @@ -29,10 +30,13 @@ on:

jobs:
cibuildwheel:
strategy:
matrix:
python-tag: ${{ fromJSON(inputs.python-tags) }}
runs-on: ${{ inputs.os }}
steps:
- name: Get build identifier for cibuildwheel
run: echo "BUILD_IDENTIFIER=${{ inputs.python-tag }}-${{ inputs.platform-tag }}" >> $GITHUB_ENV
run: echo "BUILD_IDENTIFIER=${{ matrix.python-tag }}-${{ inputs.platform-tag }}" >> $GITHUB_ENV
shell: bash

- name: Show job status for commit
Expand Down Expand Up @@ -79,7 +83,7 @@ jobs:
# There is a bug that builds macOS x86_64 wheels instead, so we install this Python 3.8 native ARM build to ensure
# the wheel is compiled for macOS arm64
# https://cibuildwheel.pypa.io/en/stable/faq/#macos-building-cpython-38-wheels-on-arm64
if: ${{ inputs.python-tag == 'cp38' && inputs.platform-tag == 'macosx_arm64' }}
if: ${{ matrix.python-tag == 'cp38' && inputs.platform-tag == 'macosx_arm64' }}
run: |
curl -o /tmp/Python38.pkg https://www.python.org/ftp/python/3.8.10/python-3.8.10-macos11.pkg
sudo installer -pkg /tmp/Python38.pkg -target /
Expand Down

0 comments on commit 07ef496

Please sign in to comment.