v2.2.5 #24
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: publish | |
on: | |
release: | |
types: [released, prereleased] | |
jobs: | |
publish: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: "3.x" | |
- name: Caching pip packages | |
uses: actions/cache@v3 | |
id: pip-cache # use this to check for `cache-hit` (`steps.pip-cache.outputs.cache-hit != 'true'`) | |
with: | |
path: ~/.cache/pip | |
key: ${{ runner.os }}-pip-${{ hashFiles('**/setup.py') }} | |
restore-keys: | | |
${{ runner.os }}-pip- | |
- name: Installing pip dependencies | |
run: | | |
python -m pip install --upgrade pip | |
python -m pip install -r requirements.txt | |
python -m pip install mypy flake8 pytest | |
python -m pip install setuptools build twine | |
continue-on-error: false | |
- name: Linting | |
run: | | |
flake8 src | |
flake8 tests | |
- name: Checking static types | |
run: mypy src | |
- name: Generating clickgen `stubfile` | |
run: make stubgen | |
- name: Building | |
run: python -m build | |
continue-on-error: false | |
- uses: actions/upload-artifact@master | |
if: success() | |
with: | |
name: dist | |
path: dist | |
- name: Testing | |
run: | | |
python -m pip install dist/clickgen-*.tar.gz | |
python -m pytest | |
continue-on-error: false | |
- name: Publishing to PyPI | |
env: | |
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }} | |
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }} | |
run: | | |
twine --version | |
twine upload dist/* |