Skip to content

build mac wheels

build mac wheels #48

Workflow file for this run

name: Publish in GitHub Package Registry
on:
release:
types: [published]
jobs:
build_wheels:
name: Build wheels on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, macOS-latest]
#[ubuntu-20.04,macOS-11]
#, windows-2019, macOS-10.15]
steps:
- uses: actions/checkout@v4
# Used to host cibuildwheel
- uses: actions/setup-python@v5
- name: Set up QEMU
if: runner.os == 'Linux'
uses: docker/setup-qemu-action@v3
with:
platforms: all
- name: Install cibuildwheel
run: python -m pip install cibuildwheel==3.3.1
- name: Build on Linux
env:
CIBW_BUILD: cp39-* cp310-* cp311-* cp312-*
CIBW_SKIP: "*-musllinux_*"
CIBW_ARCHS_LINUX: "x86_64 aarch64"
CIBW_ENVIRONMENT: "CC=gcc FC=gfortran CLIMT_ARCH=Linux"
if: ${{ runner.os == 'Linux' }}
run: python -m cibuildwheel --output-dir dist
- name: Build on macOS
env:
CIBW_BUILD: cp39-* cp310-* cp311-* cp312-*
CIBW_ARCHS_MACOS: "arm64"
CIBW_ENVIRONMENT: "CLIMT_ARCH=Darwin MACOSX_DEPLOYMENT_TARGET=15.0"
if: ${{ runner.os == 'macOS' }}
run: python -m cibuildwheel --output-dir dist
- name: Store the distribution packages
uses: actions/upload-artifact@v4
with:
name: python-package-distributions-${{ matrix.os }}
path: dist/
publish-to-pypi:
name: Publishing to PyPI
needs:
- build_wheels
runs-on: ubuntu-latest
environment:
name: pypi
url: https://pypi.org/p/climt # Replace <package-name> with your PyPI project name
permissions:
id-token: write # IMPORTANT: mandatory for trusted publishing
steps:
- name: Download all the dists
uses: actions/download-artifact@v4
with:
pattern: python-package-distributions-*
merge-multiple: true
path: dist/
- name: Publish wheels to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
# # - name: upload wheels
# # env:
# # TWINE_USERNAME: ${{ secrets.TWINE_USERNAME }}
# # TWINE_PASSWORD: ${{ secrets.TWINE_PASSWORD }}
# # run: twine upload wheelhouse/* --verbose