build macos intel #55
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build | |
on: | |
push: | |
branches: | |
- main | |
tags: | |
- "*.*.*" | |
pull_request: | |
branches: | |
- main | |
types: [opened, reopened, synchronize] | |
jobs: | |
install_and_test: | |
name: Install project and test on ${{ matrix.os }} | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
os: ["ubuntu-latest", "windows-latest", "macos-latest"] | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-python@v5 | |
with: | |
python-version: "3.13.0-beta.1" | |
- name: "Install project on ${{ matrix.os }}" | |
run: | | |
pip install . | |
- name: Run tests on ${{ matrix.os }} | |
run: | | |
python tests/test_audioop.py | |
build_wheels: | |
name: Build wheels on ${{ matrix.os }} | |
runs-on: ${{ matrix.os }} | |
needs: [install_and_test] | |
strategy: | |
matrix: | |
os: ["ubuntu-latest", "windows-latest", "macos-latest"] | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Build wheels | |
uses: pypa/cibuildwheel@v2.19.1 | |
env: | |
CIBW_BUILD: "cp313-*" | |
CIBW_ARCHS_MACOS: all | |
CIBW_PRERELEASE_PYTHONS: true | |
- uses: actions/upload-artifact@v4 | |
with: | |
name: artifact-cibw-wheels-${{ matrix.os }}-${{ strategy.job-index }} | |
path: ./wheelhouse/*.whl | |
make-sdist: | |
name: Make source distribution | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- run: pipx run build --sdist | |
- uses: actions/upload-artifact@v4 | |
with: | |
name: artifact-source-dist | |
path: "./**/dist/*.tar.gz" | |
upload_pypi: | |
if: github.event_name == 'push' && github.ref_type == 'tag' | |
name: Publish built wheels to Pypi | |
runs-on: ubuntu-latest | |
environment: release | |
needs: [install_and_test, build_wheels] | |
permissions: | |
id-token: write | |
steps: | |
- uses: actions/download-artifact@v4 | |
- name: Copy artifacts to dist/ folder | |
run: | | |
find . -name 'artifact-*' -exec unzip '{}' \; | |
mkdir -p dist/ | |
find . -name '*.tar.gz' -exec mv '{}' dist/ \; | |
find . -name '*.whl' -exec mv '{}' dist/ \; | |
- uses: pypa/gh-action-pypi-publish@release/v1 | |
name: Publish to PyPI |