Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ci: separate build-wheels from publish #370

Merged
merged 8 commits into from
Feb 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
43 changes: 43 additions & 0 deletions .github/workflows/build-wheels.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: Build Wheels

on:
pull_request: {}
workflow_call:

jobs:
build-wheels:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-22.04, macos-latest, windows-latest]
python: [cp39, cp310, cp311, cp312]
arch: [x86_64, amd64]
exclude:
- os: macos-latest
arch: amd64
- os: ubuntu-22.04
arch: amd64
- os: windows-latest
arch: x86_64
env:
CIBW_BUILD: ${{ matrix.python }}*${{ matrix.arch }}
CIBW_TEST_REQUIRES: pytest neo[neomatlabio]>=0.5.1 pytest-xdist>=3.3.1
CIBW_TEST_COMMAND: pytest -sx -n auto {project}/tests
CIBW_SKIP: "*-musllinux_*"
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: 3.9 # This might need to be dynamic based on the matrix
- name: Install cibuildwheel
run: pip install cibuildwheel
- name: Build wheels
run: cibuildwheel --output-dir wheelhouse
- uses: actions/upload-artifact@v4
with:
name: wheels-${{ matrix.os }}-${{ matrix.python }}-${{ matrix.arch }}
path: ./wheelhouse/*.whl
43 changes: 3 additions & 40 deletions .github/workflows/build.yml → .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Build
name: Publish

on:
push:
Expand Down Expand Up @@ -46,47 +46,10 @@ jobs:
tag_name: ${{ env.TAG_NAME }}
name: ${{ env.TAG_NAME }}
generate_release_notes: true

wheels:
needs: [call-test-workflow, tag]
name: Build wheels for ${{ matrix.python }} ${{ matrix.os }} ${{ matrix.arch }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-22.04, macos-latest, windows-latest]
python: [cp39, cp310, cp311, cp312]
arch: [x86_64, amd64]
exclude:
- os: macos-latest
arch: amd64
- os: ubuntu-22.04
arch: amd64
- os: windows-latest
arch: x86_64

env:
CIBW_BUILD: ${{ matrix.python }}*${{ matrix.arch }}
CIBW_TEST_REQUIRES: pytest neo[neomatlabio]>=0.5.1 pytest-xdist>=3.3.1
CIBW_TEST_COMMAND: pytest -sx -n auto {project}/tests
CIBW_SKIP: "*-musllinux_*"

steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up Python 3.9
uses: actions/setup-python@v5
with:
python-version: 3.9
- name: Install cibuildwheel
run: pip install cibuildwheel
- name: Build wheels
run: cibuildwheel --output-dir wheelhouse
- uses: actions/upload-artifact@v4
with:
name: wheels-${{ matrix.os }}-${{ matrix.python }}-${{ matrix.arch }}
path: ./wheelhouse/*.whl
uses: ./.github/workflows/build-wheels.yml

tarball:
name: Build tarball
Expand Down
Loading