Skip to content

Commit

Permalink
Rewrite CI (#9)
Browse files Browse the repository at this point in the history
  • Loading branch information
m1stadev committed Apr 22, 2024
1 parent c3a5ea2 commit 27076fd
Show file tree
Hide file tree
Showing 3 changed files with 68 additions and 84 deletions.
68 changes: 68 additions & 0 deletions .github/workflows/pypi-build-publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
name: Build wheels for Linux/macOS, build sdist, and publish to PyPI

on:
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
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
48 changes: 0 additions & 48 deletions .github/workflows/python-publish-macos-and-linux.yml

This file was deleted.

36 changes: 0 additions & 36 deletions .github/workflows/python-publish-windows.yml

This file was deleted.

0 comments on commit 27076fd

Please sign in to comment.