Skip to content

Commit

Permalink
Rework build wheels
Browse files Browse the repository at this point in the history
  • Loading branch information
peterspackman committed Nov 25, 2023
1 parent ede12bc commit 111ebff
Show file tree
Hide file tree
Showing 2 changed files with 70 additions and 71 deletions.
73 changes: 70 additions & 3 deletions .github/workflows/pythonpackage.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: Test
name: Build package

on: [push]
on: [push, pull_request]

jobs:
build:
Expand All @@ -10,7 +10,7 @@ jobs:
max-parallel: 4
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
python-version: ['3.9', '3.10', '3.11']
python-version: ['3.9', '3.10', '3.11', '3.12']

steps:
- uses: actions/checkout@v4
Expand Down Expand Up @@ -64,3 +64,70 @@ jobs:
- name: Run tests
run: |
python -m pytest
build_wheels:
runs-on: ${{matrix.os}}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
pyver: [cp39, cp310, cp311, cp312]

steps:
- name: Checkout code
uses: actions/checkout@v3

- name: Build wheels
uses: pypa/[email protected]
env:
CIBW_BUILD: ${{matrix.pyver}}-*
CIBW_ARCHS_LINUX: auto
CIBW_ARCHS_MACOS: auto universal2
CIBW_ARCHS_WINDOWS: auto
# musllinux tests fail with some pid mixup
# cross-build macos images can't be tested on this runner.
CIBW_TEST_SKIP: >-
*-*
- name: Upload artifacts
uses: actions/upload-artifact@v3
with:
name: wheels
path: ./wheelhouse/*.whl

create-release:
runs-on: ubuntu-latest
needs: build_wheels
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v')
steps:

- name: Checkout code
uses: actions/checkout@v2

- name: Download Artifacts
uses: actions/download-artifact@v3
with:
name: wheels

- name: Release
uses: softprops/action-gh-release@v1
with:
files: |
wheels/*
upload_all:
runs-on: ubuntu-latest
needs: build_wheels
environment: pypi
permissions:
id-token: write
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v')
steps:
- uses: actions/download-artifact@v3
with:
name: wheels
path: dist

- uses: pypa/gh-action-pypi-publish@release/v1
68 changes: 0 additions & 68 deletions .github/workflows/wheels.yml

This file was deleted.

0 comments on commit 111ebff

Please sign in to comment.