Skip to content

Build Upload MacOS

Build Upload MacOS #1

Workflow file for this run

name: Build Upload MacOS
on:
push:
tags:
- 'v*.*.*'
workflow_dispatch:
permissions:
contents: read
jobs:
build-and-publish:
strategy:
matrix:
os: [macos-latest]
python-version: ['3.8']
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up Python
uses: actions/setup-python@v3
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install --upgrade setuptools wheel twine cibuildwheel==1.9.0 delocate==0.10.7
- name: Set MACOSX_DEPLOYMENT_TARGET
run: echo "MACOSX_DEPLOYMENT_TARGET=10.15" >> $GITHUB_ENV
- name: Build package
env:
CIBW_ARCHS: "x86_64 arm64"
run: |
cibuildwheel --platform auto --output-dir wheelhouse
- name: List wheelhouse contents
run: ls -l wheelhouse
- name: List wheel dependencies
run: |
delocate-listdeps --all wheelhouse/*.whl
- name: Check binary architectures
run: |
for whl in wheelhouse/*.whl; do
unzip -l "$whl"
delocate-listdeps --depending "$whl"
delocate-listdeps --all "$whl"
done
- name: Repair wheel
run: |
delocate-wheel --require-archs x86_64 -w repaired_wheel wheelhouse/*.whl --verbose
- name: Publish package
if: github.event_name == 'push'
env:
TWINE_USERNAME: __token__
TWINE_PASSWORD: ${{ secrets.PYPI_API_TOKEN }}
run: |
twine upload repaired_wheel/*.whl