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
|
2022-02-11 02:28:08 +00:00
|
|
|
# expected. Using Windows and Python 3.6, since that is often the most
|
2020-09-30 19:48:08 +00:00
|
|
|
# challenging matrix element.
|
|
|
|
test-packaging:
|
2022-02-11 02:28:08 +00:00
|
|
|
name: 🐍 3.6 • 📦 tests • windows-latest
|
2020-09-30 19:48:08 +00:00
|
|
|
runs-on: windows-latest
|
|
|
|
|
|
|
|
steps:
|
2022-04-24 20:49:13 +00:00
|
|
|
- uses: actions/checkout@v3
|
2020-09-30 19:48:08 +00:00
|
|
|
|
2022-02-11 02:28:08 +00:00
|
|
|
- name: Setup 🐍 3.6
|
2022-07-04 14:24:55 +00:00
|
|
|
uses: actions/setup-python@v4
|
2020-09-30 19:48:08 +00:00
|
|
|
with:
|
2022-02-11 02:28:08 +00:00
|
|
|
python-version: 3.6
|
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:
|
2022-04-24 20:49:13 +00:00
|
|
|
- uses: actions/checkout@v3
|
2020-09-30 19:48:08 +00:00
|
|
|
|
|
|
|
- name: Setup 🐍 3.8
|
2022-07-04 14:24:55 +00:00
|
|
|
uses: actions/setup-python@v4
|
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: |
|
|
|
|
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
|
2022-04-24 20:49:41 +00:00
|
|
|
uses: actions/upload-artifact@v3
|
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
|
2022-04-24 20:49:41 +00:00
|
|
|
uses: actions/upload-artifact@v3
|
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]
|
|
|
|
|
|
|
|
steps:
|
2022-07-04 14:24:55 +00:00
|
|
|
- uses: actions/setup-python@v4
|
|
|
|
with:
|
|
|
|
python-version: "3.x"
|
2020-09-30 19:48:08 +00:00
|
|
|
|
2020-09-30 21:46:55 +00:00
|
|
|
# Downloads all to directories matching the artifact names
|
2022-04-24 18:41:23 +00:00
|
|
|
- uses: actions/download-artifact@v3
|
2020-09-30 19:48:08 +00:00
|
|
|
|
2020-09-30 21:46:55 +00:00
|
|
|
- name: Publish standard package
|
2023-05-03 04:34:51 +00:00
|
|
|
uses: pypa/gh-action-pypi-publish@v1.8.6
|
2020-09-30 19:48:08 +00:00
|
|
|
with:
|
|
|
|
password: ${{ secrets.pypi_password }}
|
2023-03-16 18:18:44 +00:00
|
|
|
packages-dir: standard/
|
2020-09-30 21:46:55 +00:00
|
|
|
|
|
|
|
- name: Publish global package
|
2023-05-03 04:34:51 +00:00
|
|
|
uses: pypa/gh-action-pypi-publish@v1.8.6
|
2020-09-30 21:46:55 +00:00
|
|
|
with:
|
|
|
|
password: ${{ secrets.pypi_password_global }}
|
2023-03-16 18:18:44 +00:00
|
|
|
packages-dir: global/
|