Add upload to test pypi #19
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: CI | |
on: | |
push: | |
branches: | |
- '*' | |
paths-ignore: | |
- README.md | |
pull_request: | |
branches: | |
- master | |
paths-ignore: | |
- README.md | |
jobs: | |
build: | |
name: Build the package | |
runs-on: ${{ matrix.os }} | |
strategy: | |
fail-fast: false | |
matrix: | |
os: [windows-latest, macos-latest, ubuntu-latest] | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Pull pybind11 | |
run: git submodule update --init --recursive | |
- uses: actions/setup-python@v5 | |
with: | |
python-version: '3.9' | |
- name: Install dependencies | |
run: pip install -r requirements.txt | |
- name: Build the package | |
run: python -m build | |
build-wheels: | |
name: Build wheels | |
runs-on: ${{ matrix.os }} | |
strategy: | |
fail-fast: true | |
matrix: | |
os: [windows-latest, macos-latest, ubuntu-latest] | |
needs: build | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Pull pybind11 | |
run: git submodule update --init --recursive | |
- uses: actions/setup-python@v5 | |
with: | |
python-version: '3.9' | |
- name: Install cibuildwheel | |
run: pip install wheel setuptools cibuildwheel==2.21.3 | |
- name: Build wheels | |
run: python -m cibuildwheel --output-dir wheelhouse | |
- name: Upload wheels | |
uses: actions/upload-artifact@v4 | |
with: | |
name: wheels-${{ runner.os }} | |
path: ./wheelhouse/*.whl | |
publish: | |
name: Publish wheels to pypi | |
runs-on: ubuntu-latest | |
needs: build-wheels | |
steps: | |
- name: Download all dists | |
uses: actions/download-artifact@v4 | |
with: | |
path: dist | |
pattern: wheels-* | |
merge-multiple: true | |
- name: Publish package to TestPyPI | |
uses: pypa/gh-action-pypi-publish@release/v1 | |
with: | |
password: ${{ secrets.TEST_PYPI_API_TOKEN }} | |
repository-url: https://test.pypi.org/legacy/ | |
verbose: true |