2020-09-30 19:48:08 +00:00
|
|
|
name: Pip
|
|
|
|
|
|
|
|
on:
|
|
|
|
workflow_dispatch:
|
|
|
|
pull_request:
|
|
|
|
push:
|
|
|
|
branches:
|
|
|
|
- master
|
|
|
|
- stable
|
|
|
|
- v*
|
|
|
|
release:
|
|
|
|
types:
|
|
|
|
- published
|
|
|
|
|
2023-05-15 17:02:25 +00:00
|
|
|
permissions:
|
|
|
|
contents: read
|
|
|
|
|
2021-10-26 18:50:34 +00:00
|
|
|
env:
|
2023-06-17 14:02:23 +00:00
|
|
|
PIP_BREAK_SYSTEM_PACKAGES: 1
|
2021-10-26 18:50:34 +00:00
|
|
|
PIP_ONLY_BINARY: numpy
|
|
|
|
|
2020-09-30 19:48:08 +00:00
|
|
|
jobs:
|
|
|
|
# This builds the sdists and wheels and makes sure the files are exactly as
|
2024-06-22 04:55:00 +00:00
|
|
|
# expected.
|
2020-09-30 19:48:08 +00:00
|
|
|
test-packaging:
|
2024-06-22 04:55:00 +00:00
|
|
|
name: 🐍 3.8 • 📦 tests • windows-latest
|
2020-09-30 19:48:08 +00:00
|
|
|
runs-on: windows-latest
|
|
|
|
|
|
|
|
steps:
|
2023-09-06 19:57:18 +00:00
|
|
|
- uses: actions/checkout@v4
|
2020-09-30 19:48:08 +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
|
2020-09-30 19:48:08 +00:00
|
|
|
with:
|
2024-06-22 04:55:00 +00:00
|
|
|
python-version: 3.8
|
2020-09-30 19:48:08 +00:00
|
|
|
|
|
|
|
- name: Prepare env
|
2021-10-26 18:50:34 +00:00
|
|
|
run: |
|
|
|
|
python -m pip install -r tests/requirements.txt
|
2020-09-30 19:48:08 +00:00
|
|
|
|
|
|
|
- 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
|
2020-09-30 19:48:08 +00:00
|
|
|
|
|
|
|
- name: Setup 🐍 3.8
|
2023-12-07 05:09:08 +00:00
|
|
|
uses: actions/setup-python@v5
|
2020-09-30 19:48:08 +00:00
|
|
|
with:
|
|
|
|
python-version: 3.8
|
|
|
|
|
|
|
|
- name: Prepare env
|
2021-10-26 18:50:34 +00:00
|
|
|
run: |
|
2024-06-26 03:51:27 +00:00
|
|
|
python -m pip install -r tests/requirements.txt build twine
|
2020-09-30 19:48:08 +00:00
|
|
|
|
|
|
|
- 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/*
|
|
|
|
|
2020-09-30 21:46:55 +00:00
|
|
|
- name: Save standard package
|
2023-12-15 02:50:09 +00:00
|
|
|
uses: actions/upload-artifact@v4
|
2020-09-30 19:48:08 +00:00
|
|
|
with:
|
2020-09-30 21:46:55 +00:00
|
|
|
name: standard
|
|
|
|
path: dist/pybind11-*
|
|
|
|
|
|
|
|
- name: Save global package
|
2023-12-15 02:50:09 +00:00
|
|
|
uses: actions/upload-artifact@v4
|
2020-09-30 21:46:55 +00:00
|
|
|
with:
|
|
|
|
name: global
|
|
|
|
path: dist/pybind11_global-*
|
|
|
|
|
2020-09-30 19:48:08 +00:00
|
|
|
|
|
|
|
|
|
|
|
# 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-06-26 01:12:58 +00:00
|
|
|
environment: pypi
|
|
|
|
permissions:
|
|
|
|
id-token: write
|
|
|
|
attestations: write
|
|
|
|
contents: read
|
2020-09-30 19:48:08 +00:00
|
|
|
|
|
|
|
steps:
|
2020-09-30 21:46:55 +00:00
|
|
|
# Downloads all to directories matching the artifact names
|
2023-12-15 02:46:13 +00:00
|
|
|
- uses: actions/download-artifact@v4
|
2020-09-30 19:48:08 +00:00
|
|
|
|
2024-06-26 01:12:58 +00:00
|
|
|
- name: Generate artifact attestation for sdist and wheel
|
2024-08-26 03:35:03 +00:00
|
|
|
uses: actions/attest-build-provenance@6149ea5740be74af77f260b9db67e633f6b0a9a1 # v1.4.2
|
2024-06-26 01:12:58 +00:00
|
|
|
with:
|
|
|
|
subject-path: "*/pybind11*"
|
|
|
|
|
2020-09-30 21:46:55 +00:00
|
|
|
- name: Publish standard package
|
2023-07-12 15:55:18 +00:00
|
|
|
uses: pypa/gh-action-pypi-publish@release/v1
|
2020-09-30 19:48:08 +00:00
|
|
|
with:
|
2023-03-16 18:18:44 +00:00
|
|
|
packages-dir: standard/
|
2020-09-30 21:46:55 +00:00
|
|
|
|
|
|
|
- name: Publish global package
|
2023-07-12 15:55:18 +00:00
|
|
|
uses: pypa/gh-action-pypi-publish@release/v1
|
2020-09-30 21:46:55 +00:00
|
|
|
with:
|
2023-03-16 18:18:44 +00:00
|
|
|
packages-dir: global/
|