diff --git a/.github/workflows/python-wheel.yml b/.github/workflows/python-wheel.yml new file mode 100644 index 00000000000..d2f6eb7911a --- /dev/null +++ b/.github/workflows/python-wheel.yml @@ -0,0 +1,107 @@ +name: Build and release wheels + +on: + merge_group: + types: [ checks_requested ] + workflow_dispatch: + 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 diff --git a/pyo3-introspection/pyproject.toml b/pyo3-introspection/pyproject.toml new file mode 100644 index 00000000000..76ff4171825 --- /dev/null +++ b/pyo3-introspection/pyproject.toml @@ -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"