updating upload version #4
Workflow file for this run
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: Build and Publish Wheels | |
on: | |
push: | |
tags: | |
- 'v*.*.*' | |
jobs: | |
build_wheels: | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
os: [ubuntu-latest, windows-latest, macos-latest] | |
python-version: ['3.10', '3.11'] | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install wheel | |
- name: Build wheels | |
run: pip wheel . --wheel-dir wheelhouse | |
- name: Upload wheels | |
uses: actions/upload-artifact@v4 | |
with: | |
name: wheelhouse | |
path: wheelhouse/ | |
test_wheels: | |
runs-on: ubuntu-latest | |
needs: build_wheels | |
strategy: | |
matrix: | |
python-version: ['3.10', '3.11'] | |
steps: | |
- uses: actions/download-artifact@v2 | |
with: | |
name: wheelhouse | |
path: wheelhouse/ | |
- name: Set up Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Install test dependencies | |
run: | | |
pip install pytest | |
pip install wheelhouse/*.whl | |
- name: Run tests | |
run: pytest | |
publish_wheels: | |
runs-on: ubuntu-latest | |
needs: test_wheels | |
if: startsWith(github.ref, 'refs/tags/') | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: '3.10' | |
- uses: actions/download-artifact@v2 | |
with: | |
name: wheelhouse | |
path: wheelhouse/ | |
- name: Publish package to Test PyPI | |
uses: pypa/gh-action-pypi-publish@release/v1 | |
with: | |
user: __token__ | |
password: ${{ secrets.TEST_PYPI_API_TOKEN }} | |
repository_url: https://test.pypi.org/legacy/ |