Skip to content

Update copyright year range in documentation #80

Update copyright year range in documentation

Update copyright year range in documentation #80

name: Test and Publish
on:
- push
- pull_request
jobs:
test-code:
name: Test code
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-20.04, macos-10.15]
python-version:
- '3.7'
- '3.8'
- '3.9'
- '3.10'
steps:
- name: Check out code
uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install .[tests] tox-gh-actions
- name: Test with Tox
run: tox
test-docs:
name: Test documentation
runs-on: ubuntu-20.04
env:
PYTHON_VERSION: '3.x'
steps:
- name: Check out code
uses: actions/checkout@v4
- name: Set up Python ${{ env.PYTHON_VERSION }}
uses: actions/setup-python@v4
with:
python-version: ${{ env.PYTHON_VERSION }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install .[docs]
- name: Build documentation
working-directory: docs
run: make html
publish-to-test-pypi:
name: Publish to TestPyPI
environment: staging
runs-on: ubuntu-20.04
if: github.ref == 'refs/heads/main' && github.event_name == 'push'
needs:
- test-code
- test-docs
steps:
- name: Check out code
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.x'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install --upgrade setuptools wheel twine build
- name: Build and publish
env:
TWINE_USERNAME: '__token__'
TWINE_PASSWORD: ${{ secrets.PYPI_API_TOKEN }}
run: |
python -m build
twine upload --repository testpypi dist/*
publish-to-pypi:
name: Publish to PyPI
environment: production
runs-on: ubuntu-20.04
if: github.ref == 'refs/heads/main' && github.event_name == 'push'
needs: publish-to-test-pypi
steps:
- name: Check out code
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.x'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install --upgrade setuptools wheel twine build
- name: Build and publish
env:
TWINE_USERNAME: '__token__'
TWINE_PASSWORD: ${{ secrets.PYPI_API_TOKEN }}
run: |
python -m build
twine upload dist/*