16 # This builds the sdists and wheels and makes sure the files are exactly as
17 # expected. Using Windows and Python 2.7, since that is often the most
18 # challenging matrix element.
20 name: 🐍 2.7 • 📦 tests • windows-latest
21 runs-on: windows-latest
24 - uses: actions/checkout@v2
27 uses: actions/setup-python@v2
32 run: python -m pip install -r tests/requirements.txt --prefer-binary
34 - name: Python Packaging tests
35 run: pytest tests/extra_python_package/
38 # This runs the packaging tests and also builds and saves the packages as
41 name: 🐍 3.8 • 📦 & 📦 tests • ubuntu-latest
42 runs-on: ubuntu-latest
45 - uses: actions/checkout@v2
48 uses: actions/setup-python@v2
53 run: python -m pip install -r tests/requirements.txt build twine --prefer-binary
55 - name: Python Packaging tests
56 run: pytest tests/extra_python_package/
58 - name: Build SDist and wheels
61 PYBIND11_GLOBAL_SDIST=1 python -m build
63 - name: Check metadata
64 run: twine check dist/*
66 - name: Save standard package
67 uses: actions/upload-artifact@v2
72 - name: Save global package
73 uses: actions/upload-artifact@v2
76 path: dist/pybind11_global-*
80 # When a GitHub release is made, upload the artifacts to PyPI
83 runs-on: ubuntu-latest
84 if: github.event_name == 'release' && github.event.action == 'published'
88 - uses: actions/setup-python@v2
90 # Downloads all to directories matching the artifact names
91 - uses: actions/download-artifact@v2
93 - name: Publish standard package
94 uses: pypa/gh-action-pypi-publish@v1.4.1
96 password: ${{ secrets.pypi_password }}
97 packages_dir: standard/
99 - name: Publish global package
100 uses: pypa/gh-action-pypi-publish@v1.4.1
102 password: ${{ secrets.pypi_password_global }}
103 packages_dir: global/