Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
51 changes: 0 additions & 51 deletions .github/workflows/build-and-deploy-on-pypi.yml

This file was deleted.

101 changes: 101 additions & 0 deletions .github/workflows/build-and-deploy-wheels-on-pypi.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,101 @@
name: Build and Publish Wheels

on:
release:
types: [published]
# use this for testing
push:
branches:
- main

permissions:
contents: read
id-token: write # required for PyPI trusted publishing

jobs:
build_wheels:
name: Build wheels on ${{ matrix.os }}
runs-on: ${{ matrix.os }}

strategy:
fail-fast: false
matrix:
os: [ubuntu-latest] # macos-latest

steps:
- name: Checkout source
uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.12"

- name: Build wheels
uses: pypa/cibuildwheel@v3.2.1
env:
# Build CPython 3.11-3.14
CIBW_BUILD: "cp311-* cp312-* cp313-* cp314-*"
CIBW_SKIP: "*-musllinux_* pp*"
# Run tests after build (optional)
# CIBW_TEST_COMMAND: "python -c \"import ppfive; print('import ok')\""

- name: Upload wheel artifacts
uses: actions/upload-artifact@v4
with:
name: wheels-${{ matrix.os }}
path: ./wheelhouse/*.whl

build_sdist:
name: Build source distribution
runs-on: ubuntu-latest

steps:
- name: Checkout source
uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.12"

- name: Install build backend
run: python -m pip install --upgrade build

- name: Build sdist
run: python -m build --sdist

- name: Upload sdist artifact
uses: actions/upload-artifact@v4
with:
name: sdist
path: dist/*.tar.gz

publish:
name: Publish to PyPI
needs: [build_wheels, build_sdist]
runs-on: ubuntu-latest
# publish only on version tags like v0.1.0
if: startsWith(github.ref, 'refs/tags')
environment:
name: pypi
url: https://pypi.org/project/ppfive/
permissions:
id-token: write

steps:
- name: Download all artifacts
uses: actions/download-artifact@v4
with:
path: distfiles

- name: Flatten artifacts
run: |
mkdir upload
find distfiles -type f \( -name "*.whl" -o -name "*.tar.gz" \) -exec cp {} upload/ \;
ls -la upload

- name: Publish to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
packages-dir: upload
Loading