Skip to content
Merged
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
73 changes: 70 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,11 @@ on:
branches: [main]
pull_request:
branches: [main]
release:
types: [published]

jobs:
test-and-build:
test:
runs-on: ubuntu-latest
strategy:
matrix:
Expand Down Expand Up @@ -36,5 +38,70 @@ jobs:
- name: Run tests
run: uv run pytest tests/

- name: Build wheel
run: uvx maturin build --release
build-wheels:
name: Build wheels on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
needs: test
if: github.event_name == 'release'
strategy:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]

steps:
- uses: actions/checkout@v4

- name: Build wheels
uses: PyO3/maturin-action@v1
with:
args: --release --out dist --interpreter 3.10 3.11 3.12 3.13
manylinux: auto

- name: Upload wheels
uses: actions/upload-artifact@v4
with:
name: wheels-${{ matrix.os }}
path: dist/

build-sdist:
name: Build source distribution
runs-on: ubuntu-latest
needs: test
if: github.event_name == 'release'

steps:
- uses: actions/checkout@v4

- name: Build sdist
uses: PyO3/maturin-action@v1
with:
command: sdist
args: --out dist

- name: Upload sdist
uses: actions/upload-artifact@v4
with:
name: sdist
path: dist/

pypi-publish:
name: Publish to PyPI
runs-on: ubuntu-latest
needs: [build-wheels, build-sdist]
if: github.event_name == 'release'
permissions:
id-token: write
environment:
name: pypi
url: https://pypi.org/project/pyhandlebars

steps:
- name: Download all artifacts
uses: actions/download-artifact@v4
with:
path: dist/
merge-multiple: true

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