2023-02-16 23:01:45 +00:00
|
|
|
name: Pip
|
|
|
|
|
|
|
|
on:
|
|
|
|
workflow_dispatch:
|
|
|
|
pull_request:
|
|
|
|
push:
|
|
|
|
branches:
|
|
|
|
- master
|
|
|
|
- stable
|
|
|
|
- smart_holder
|
|
|
|
- v*
|
|
|
|
release:
|
|
|
|
types:
|
|
|
|
- published
|
|
|
|
|
2023-05-15 17:02:25 +00:00
|
|
|
permissions:
|
|
|
|
contents: read
|
|
|
|
|
2023-02-16 23:01:45 +00:00
|
|
|
env:
|
2023-06-17 14:02:23 +00:00
|
|
|
PIP_BREAK_SYSTEM_PACKAGES: 1
|
2023-02-16 23:01:45 +00:00
|
|
|
PIP_ONLY_BINARY: numpy
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
# This builds the sdists and wheels and makes sure the files are exactly as
|
2024-06-22 04:55:00 +00:00
|
|
|
# expected.
|
2023-02-16 23:01:45 +00:00
|
|
|
test-packaging:
|
2024-06-22 04:55:00 +00:00
|
|
|
name: 🐍 3.8 • 📦 tests • windows-latest
|
2023-02-16 23:01:45 +00:00
|
|
|
runs-on: windows-latest
|
|
|
|
|
|
|
|
steps:
|
2023-09-06 19:57:18 +00:00
|
|
|
- uses: actions/checkout@v4
|
2023-02-16 23:01:45 +00:00
|
|
|
|
2024-06-22 04:55:00 +00:00
|
|
|
- name: Setup 🐍 3.8
|
2023-12-07 05:09:08 +00:00
|
|
|
uses: actions/setup-python@v5
|
2023-02-16 23:01:45 +00:00
|
|
|
with:
|
2024-06-22 04:55:00 +00:00
|
|
|
python-version: 3.8
|
2023-02-16 23:01:45 +00:00
|
|
|
|
|
|
|
- name: Prepare env
|
|
|
|
run: |
|
|
|
|
python -m pip install -r tests/requirements.txt
|
|
|
|
|
|
|
|
- name: Python Packaging tests
|
|
|
|
run: pytest tests/extra_python_package/
|
|
|
|
|
|
|
|
|
|
|
|
# This runs the packaging tests and also builds and saves the packages as
|
|
|
|
# artifacts.
|
|
|
|
packaging:
|
|
|
|
name: 🐍 3.8 • 📦 & 📦 tests • ubuntu-latest
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
|
|
|
|
steps:
|
2023-09-06 19:57:18 +00:00
|
|
|
- uses: actions/checkout@v4
|
2023-02-16 23:01:45 +00:00
|
|
|
|
|
|
|
- name: Setup 🐍 3.8
|
2023-12-07 05:09:08 +00:00
|
|
|
uses: actions/setup-python@v5
|
2023-02-16 23:01:45 +00:00
|
|
|
with:
|
|
|
|
python-version: 3.8
|
|
|
|
|
|
|
|
- name: Prepare env
|
|
|
|
run: |
|
|
|
|
python -m pip install -r tests/requirements.txt build twine
|
|
|
|
|
|
|
|
- name: Python Packaging tests
|
|
|
|
run: pytest tests/extra_python_package/
|
|
|
|
|
|
|
|
- name: Build SDist and wheels
|
|
|
|
run: |
|
|
|
|
python -m build
|
|
|
|
PYBIND11_GLOBAL_SDIST=1 python -m build
|
|
|
|
|
|
|
|
- name: Check metadata
|
|
|
|
run: twine check dist/*
|
|
|
|
|
|
|
|
- name: Save standard package
|
2023-12-15 02:50:09 +00:00
|
|
|
uses: actions/upload-artifact@v4
|
2023-02-16 23:01:45 +00:00
|
|
|
with:
|
|
|
|
name: standard
|
|
|
|
path: dist/pybind11-*
|
|
|
|
|
|
|
|
- name: Save global package
|
2023-12-15 02:50:09 +00:00
|
|
|
uses: actions/upload-artifact@v4
|
2023-02-16 23:01:45 +00:00
|
|
|
with:
|
|
|
|
name: global
|
|
|
|
path: dist/pybind11_global-*
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# When a GitHub release is made, upload the artifacts to PyPI
|
|
|
|
upload:
|
|
|
|
name: Upload to PyPI
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
if: github.event_name == 'release' && github.event.action == 'published'
|
|
|
|
needs: [packaging]
|
2024-09-14 00:21:43 +00:00
|
|
|
environment:
|
|
|
|
name: pypi
|
|
|
|
url: https://pypi.org/p/pybind11
|
2024-06-26 01:12:58 +00:00
|
|
|
permissions:
|
|
|
|
id-token: write
|
|
|
|
attestations: write
|
2023-02-16 23:01:45 +00:00
|
|
|
|
|
|
|
steps:
|
|
|
|
# Downloads all to directories matching the artifact names
|
2023-12-15 02:46:13 +00:00
|
|
|
- uses: actions/download-artifact@v4
|
2023-02-16 23:01:45 +00:00
|
|
|
|
2024-06-26 01:12:58 +00:00
|
|
|
- name: Generate artifact attestation for sdist and wheel
|
2024-09-09 18:31:38 +00:00
|
|
|
uses: actions/attest-build-provenance@1c608d11d69870c2092266b3f9a6f3abbf17002c # v1.4.3
|
2024-06-26 01:12:58 +00:00
|
|
|
with:
|
|
|
|
subject-path: "*/pybind11*"
|
|
|
|
|
2023-02-16 23:01:45 +00:00
|
|
|
- name: Publish standard package
|
2023-07-12 15:55:18 +00:00
|
|
|
uses: pypa/gh-action-pypi-publish@release/v1
|
2023-02-16 23:01:45 +00:00
|
|
|
with:
|
2023-03-16 18:18:44 +00:00
|
|
|
packages-dir: standard/
|
2024-09-14 00:21:43 +00:00
|
|
|
attestations: true
|
2023-02-16 23:01:45 +00:00
|
|
|
|
|
|
|
- name: Publish global package
|
2023-07-12 15:55:18 +00:00
|
|
|
uses: pypa/gh-action-pypi-publish@release/v1
|
2023-02-16 23:01:45 +00:00
|
|
|
with:
|
2023-03-16 18:18:44 +00:00
|
|
|
packages-dir: global/
|
2024-09-14 00:21:43 +00:00
|
|
|
attestations: true
|