-
-
Notifications
You must be signed in to change notification settings - Fork 4
68 lines (56 loc) · 1.67 KB
/
publish.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
name: publish
on:
release:
types: [released, prereleased]
jobs:
publish:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v4
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/*