Skip to content

README: add PyPI version + license badges and a top-of-page install line #6

README: add PyPI version + license badges and a top-of-page install line

README: add PyPI version + license badges and a top-of-page install line #6

Workflow file for this run

# Build platform wheels for `pyfun-lang` and publish to PyPI on a version tag.
#
# Publishing uses PyPI Trusted Publishing (OIDC) — there is NO API token to manage.
# One-time setup before the first release: on PyPI, add a Trusted Publisher for this
# repo pointing at workflow `wheels.yml` and environment `pypi`
# (https://docs.pypi.org/trusted-publishers/). Until that exists, the build jobs still
# run on every push/PR; only the final `release` job needs it, and it runs only on tags.
#
# The wheel matrix is deliberately lean (the common student/dev platforms). Any platform
# without a wheel falls back to the sdist and builds from source (needs Rust). To widen
# coverage, regenerate the full skeleton with: maturin generate-ci github
name: wheels
on:
push:
branches: [main]
tags: ['*']
pull_request:
workflow_dispatch:
permissions:
contents: read
concurrency:
group: wheels-${{ github.ref }}
cancel-in-progress: true
jobs:
linux:
runs-on: ubuntu-22.04
strategy:
matrix:
target: [x86_64, aarch64]
steps:
- uses: actions/checkout@v6
- name: Build wheels
uses: PyO3/maturin-action@v1
with:
target: ${{ matrix.target }}
args: --release --out dist
sccache: ${{ !startsWith(github.ref, 'refs/tags/') }}
manylinux: auto
- uses: actions/upload-artifact@v6
with:
name: wheels-linux-${{ matrix.target }}
path: dist
windows:
runs-on: windows-latest
steps:
- uses: actions/checkout@v6
- name: Build wheels
uses: PyO3/maturin-action@v1
with:
target: x64
args: --release --out dist
sccache: ${{ !startsWith(github.ref, 'refs/tags/') }}
- uses: actions/upload-artifact@v6
with:
name: wheels-windows-x64
path: dist
macos:
runs-on: ${{ matrix.runner }}
strategy:
matrix:
include:
- runner: macos-15-intel
target: x86_64
- runner: macos-latest
target: aarch64
steps:
- uses: actions/checkout@v6
- name: Build wheels
uses: PyO3/maturin-action@v1
with:
target: ${{ matrix.target }}
args: --release --out dist
sccache: ${{ !startsWith(github.ref, 'refs/tags/') }}
- uses: actions/upload-artifact@v6
with:
name: wheels-macos-${{ matrix.target }}
path: dist
sdist:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- name: Build sdist
uses: PyO3/maturin-action@v1
with:
command: sdist
args: --out dist
- uses: actions/upload-artifact@v6
with:
name: wheels-sdist
path: dist
release:
name: Publish to PyPI
runs-on: ubuntu-latest
if: startsWith(github.ref, 'refs/tags/')
needs: [linux, windows, macos, sdist]
environment: pypi
permissions:
id-token: write # OIDC token for Trusted Publishing
attestations: write # sign the build artifacts
contents: read
steps:
- uses: actions/download-artifact@v7
with:
pattern: wheels-*
path: dist
merge-multiple: true
- name: Generate artifact attestation
uses: actions/attest-build-provenance@v2
with:
subject-path: 'dist/*'
- name: Publish to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
packages-dir: dist