Skip to content

Merge pull request #15 from xunmod/master #6

Merge pull request #15 from xunmod/master

Merge pull request #15 from xunmod/master #6

name: Build wheels for Linux/macOS, build sdist, and publish to PyPI
on:
push:
branches: [ 'master' ]
pull_request:
branches: [ 'master' ]
release:
types: published
jobs:
build_wheels:
name: Build ${{ matrix.os }} wheels
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, macos-latest]
steps:
- uses: actions/checkout@v4
- name: Set up QEMU
if: runner.os == 'Linux'
uses: docker/setup-qemu-action@v3
with:
platforms: arm64
- name: Build wheels
uses: pypa/cibuildwheel@v2.17.0
env:
CIBW_ARCHS_LINUX: x86_64 i686 aarch64
CIBW_ARCHS_MACOS: x86_64 arm64
with:
output-dir: ${{ runner.temp }}/cibw-build
- uses: actions/upload-artifact@v4
with:
name: cibw-wheels-${{ runner.os }}
path: ${{ runner.temp }}/cibw-build/*.whl
build_sdist:
name: Build source distribution
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Build sdist
run: pipx run build --sdist
- uses: actions/upload-artifact@v4
with:
name: sdist
path: dist/*.tar.gz
pypi-publish:
name: Publish release to PyPI
if: ${{ github.event_name == 'release' }}
needs: [build_wheels, build_sdist]
runs-on: ubuntu-latest
environment:
name: PyPI
url: https://pypi.org/p/pytun-pmd3
permissions:
id-token: write
steps:
- uses: actions/download-artifact@v4
with:
path: dist
merge-multiple: true
- uses: pypa/gh-action-pypi-publish@release/v1