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
107 changes: 107 additions & 0 deletions .github/workflows/python-wheel.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,107 @@
name: Build and release wheels

on:
merge_group:
types: [ checks_requested ]
workflow_dispatch:
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Was this copied from release.yml which also has workflow_dispatch event? I think having this can allow re-running the release if it fails, however maybe we should restrict it to tags to prevent accidental release on untagged stuff? (We might want to fix it on release.yml to only allow tags too?)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The pypi_release job is gated on tag push. So, it should not be possible to publish outside of a tag. I have relaxed a bit the constraint to also allow manual runs on tags: d328334

push:
tags:
- "v*"

concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref_name }}
cancel-in-progress: true

jobs:
pypi_linux:
runs-on: ubuntu-latest
strategy:
matrix:
target: [x86_64, x86, aarch64, armv7, s390x, ppc64le]
steps:
- uses: actions/checkout@v6.0.2
- uses: PyO3/maturin-action@v1
with:
target: ${{ matrix.target }}
args: --release --out dist --compatibility pypi
manylinux: auto
working-directory: pyo3-introspection
- uses: actions/upload-artifact@v7
with:
name: wheels-linux-${{ matrix.target }}
path: pyo3-introspection/dist

pypi_windows:
runs-on: ${{ matrix.platform.runner }}
strategy:
matrix:
platform:
- runner: windows-latest
target: x64
- runner: windows-latest
target: x86
- runner: windows-11-arm
target: aarch64
steps:
- uses: actions/checkout@v6.0.2
- name: Build wheels
uses: PyO3/maturin-action@v1
with:
target: ${{ matrix.platform.target }}
args: --release --out dist --compatibility pypi
working-directory: pyo3-introspection
- uses: actions/upload-artifact@v7
with:
name: wheels-windows-${{ matrix.platform.target }}
path: pyo3-introspection/dist

pypi_macos:
runs-on: ${{ matrix.platform.runner }}
strategy:
matrix:
platform:
- runner: macos-15-intel
target: x86_64
- runner: macos-latest
target: aarch64
steps:
- uses: actions/checkout@v6.0.2
- uses: PyO3/maturin-action@v1
with:
target: ${{ matrix.platform.target }}
args: --release --out dist --compatibility pypi
working-directory: pyo3-introspection
- uses: actions/upload-artifact@v7
with:
name: wheels-macos-${{ matrix.platform.target }}
path: pyo3-introspection/dist

pypi_sdist:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6.0.2
- uses: PyO3/maturin-action@v1
with:
command: sdist
args: --out dist
working-directory: pyo3-introspection
- uses: actions/upload-artifact@v7
with:
name: wheels-sdist
path: pyo3-introspection/dist

pypi_release:
if: startsWith(github.ref, 'refs/tags/')
permissions:
id-token: write

runs-on: ubuntu-latest
environment: release
needs: [pypi_linux, pypi_windows, pypi_macos, pypi_sdist]
steps:
- uses: actions/download-artifact@v8
with:
pattern: wheels-*
path: pyo3-introspection/dist
merge-multiple: true
- uses: pypa/gh-action-pypi-publish@release/v1
33 changes: 33 additions & 0 deletions pyo3-introspection/pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
[project]
name = "pyo3-introspection"
classifiers = [
"Development Status :: 3 - Alpha",
"Intended Audience :: Developers",
"License :: OSI Approved :: Apache Software License",
"License :: OSI Approved :: MIT License",
"Programming Language :: Rust",
]
dynamic = [
"authors",
"description",
"keywords",
"license",
"license-files",
"maintainers",
"readme",
"version",
]

[project.urls]
Changelog = "https://github.com/PyO3/pyo3/blob/main/CHANGELOG.md"
Documentation = "https://pyo3.rs/"
Homepage = "https://pyo3.rs/"
Source = "https://github.com/PyO3/pyo3/tree/main/pyo3-introspection"
Tracker = "https://github.com/PyO3/pyo3/issues"

[build-system]
requires = ["maturin>=1,<2"]
build-backend = "maturin"

[tool.maturin]
bindings = "bin"
Loading