File tree Expand file tree Collapse file tree 1 file changed +9
-24
lines changed
Expand file tree Collapse file tree 1 file changed +9
-24
lines changed Original file line number Diff line number Diff line change 33on :
44 push :
55 branches : [master]
6- tags : ['*']
6+ tags : ['v *']
77 pull_request :
88 branches : [master]
99
@@ -41,37 +41,22 @@ jobs:
4141 - name : Install release dependencies
4242 if : github.ref == 'refs/heads/master' && matrix.python-version == '3.8'
4343 run : |
44- pip install bump-my-version
44+ pip install bump-my-version build twine
4545 sudo npm install -g semantic-release \
4646 @semantic-release/changelog \
4747 @semantic-release/exec \
4848 @semantic-release/git \
4949 @semantic-release/github
5050
51- - name : Semantic Release
51+ - name : Semantic Release and Publish
5252 if : github.ref == 'refs/heads/master' && matrix.python-version == '3.8'
5353 env :
5454 GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
5555 GH_TOKEN : ${{ secrets.GH_TOKEN }}
56- run : npx semantic-release
57-
58- # Separate job for PyPI publishing
59- publish :
60- needs : test
61- # Changed the condition to check for any tag
62- if : github.event_name == 'push' && contains(github.ref, 'refs/tags/')
63- runs-on : ubuntu-latest
64- environment : ci
65- steps :
66- - uses : actions/checkout@v3
67- - name : Set up Python
68- uses : actions/setup-python@v4
69- with :
70- python-version : ' 3.8'
71- - name : Install dependencies
72- run : |
73- pip install build twine
74- - name : Build and publish
7556 run : |
76- python -m build
77- python -m twine upload dist/* -u __token__ -p ${{ secrets.PYPI_TOKEN }}
57+ npx semantic-release
58+ # If semantic-release was successful, build and publish to PyPI
59+ if [ $? -eq 0 ]; then
60+ python -m build
61+ python -m twine upload dist/* -u __token__ -p ${{ secrets.PYPI_TOKEN }}
62+ fi
You can’t perform that action at this time.
0 commit comments