@@ -26,21 +26,33 @@ jobs:
2626 run : |
2727 python -m pip install --upgrade pip
2828 python -m pip install --upgrade -r requirements.txt
29- python -m pip install --upgrade twine
29+ python -m pip install --upgrade build
30+
31+ - name : Build a binary wheel and a source tarball
32+ run : >-
33+ python -m
34+ build
35+ --sdist
36+ --wheel
37+ --outdir dist/
38+ .
39+
40+ - uses : actions/upload-artifact@v3
41+ with :
42+ name : python_wheel
43+ path : dist/*
44+ if-no-files-found : error
3045
31- - name : Build and publish
32- env :
33- TWINE_USERNAME : ${{ secrets.PYPI_USERNAME }}
34- TWINE_PASSWORD : ${{ secrets.PYPI_PASSWORD }}
35- run : |
36- python setup.py sdist bdist_wheel
37- twine upload dist/*
46+ - name : Publish to PyPI
47+ if : startsWith(github.ref, 'refs/tags')
48+ uses : pypa/gh-action-pypi-publish@release/v1
49+ with :
50+ password : ${{ secrets.PYPI_API_TOKEN }}
3851
3952 - name : Create/update release on GitHub
40- uses : ncipollo/release-action@v1.12.0
53+ if : startsWith(github.ref, 'refs/tags/')
54+ uses : softprops/action-gh-release@v1
4155 with :
42- allowUpdates : true
43- artifacts : " dist/*"
44- generateReleaseNotes : true
45- omitNameDuringUpdate : true
46- token : ${{ secrets.GITHUB_TOKEN }}
56+ fail_on_unmatched_files : true
57+ files : dist/*
58+ generate_release_notes : true
0 commit comments