branchbuild.yml: Upgrade GitHub Actions (#17) #73
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 | |
on: | |
push: | |
pull_request: | |
release: | |
types: | |
- published | |
jobs: | |
tests: | |
name: "Python ${{ matrix.python-version }}" | |
runs-on: "ubuntu-latest" | |
strategy: | |
matrix: | |
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"] | |
os: [ubuntu-latest, windows-latest, macos-latest] | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
submodules: 'true' | |
- uses: actions/setup-python@v4 | |
with: | |
python-version: "${{ matrix.python-version }}" | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install build pytest hypothesis mypy | |
- name: build | |
run: | | |
python -m build | |
pip install dist/*.tar.gz -v | |
pip install dist/*.whl -v | |
- name: Test type stubs | |
run: | | |
python -m mypy.stubtest jarowinkler --ignore-missing-stub | |
- name: Test with pytest | |
run: | | |
pytest tests | |
deploy: | |
if: github.event_name == 'release' && github.event.action == 'published' | |
needs: [tests] | |
name: deploy wheels to pypi | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-python@v4 | |
with: | |
python-version: '3.x' | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install build | |
- name: Build package | |
run: | | |
python -m build | |
pip install dist/*.tar.gz -v | |
pip install dist/*.whl -v | |
- name: Publish package | |
uses: pypa/gh-action-pypi-publish@release/v1 | |
with: | |
user: __token__ | |
password: ${{ secrets.PYPI_PASSWORD }} |