1818 with :
1919 path : ~/.cache/pre-commit
2020 key : pre-commit|${{ env.PYSHA }}|${{ hashFiles('.pre-commit-config.yaml') }}
21- - run : pip install -U -r requirements-dev.txt
22- - run : python setup.py sdist bdist_wheel
23- - run : twine check dist/*
21+ - run : pip install -U pre-commit
2422 - uses : reviewdog/action-setup@v1
2523 - run : |
2624 pre-commit run -a flake8 | reviewdog -f=pep8 -name=flake8 -tee -reporter=github-check -filter-mode nofilter
@@ -42,28 +40,27 @@ jobs:
4240 with :
4341 python-version : ${{ matrix.python }}
4442 - run : pip install -U -r requirements-dev.txt
45- - run : python -m tests --cov-report=term-missing
43+ - run : pytest
4644 - uses : codecov/codecov-action@v1
4745 deploy :
48- if : github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags')
4946 name : PyPI Deploy
5047 needs : [check, test]
5148 runs-on : ubuntu-latest
5249 steps :
5350 - uses : actions/checkout@v2
5451 with :
5552 fetch-depth : 0
56- - uses : casperdcl/deploy-pypi@v1
53+ - uses : actions/setup-python@v2
54+ - id : dist
55+ uses : casperdcl/deploy-pypi@v2
5756 with :
58- password : ${{ secrets.PYPI_TOKEN }}
5957 build : true
60- - id : collect_assets
61- name : Collect assets
62- run : |
63- echo "::set-output name=asset_path::$(ls dist/*.whl)"
64- echo "::set-output name=asset_name::$(basename dist/*.whl)"
65- git log --pretty='format:%d%n- %s%n%b---' $(git tag --sort=v:refname | tail -n2 | head -n1)..HEAD > _CHANGES.md
66- - id : create_release
58+ password : ${{ secrets.PYPI_TOKEN }}
59+ upload : ${{ github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags') }}
60+ - name : Changelog
61+ run : git log --pretty='format:%d%n- %s%n%b---' $(git tag --sort=v:refname | tail -n2 | head -n1)..HEAD > _CHANGES.md
62+ - if : github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags')
63+ id : create_release
6764 uses : actions/create-release@v1
6865 env :
6966 GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
@@ -72,11 +69,12 @@ jobs:
7269 release_name : shtab ${{ github.ref }} beta
7370 body_path : _CHANGES.md
7471 draft : true
75- - uses : actions/upload-release-asset@v1
72+ - if : github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags')
73+ uses : actions/upload-release-asset@v1
7674 env :
7775 GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
7876 with :
7977 upload_url : ${{ steps.create_release.outputs.upload_url }}
80- asset_path : ${{ steps.collect_assets .outputs.asset_path }}
81- asset_name : ${{ steps.collect_assets .outputs.asset_name }}
78+ asset_path : dist/ ${{ steps.dist .outputs.whl }}
79+ asset_name : ${{ steps.dist .outputs.whl }}
8280 asset_content_type : application/zip
0 commit comments