File tree Expand file tree Collapse file tree 2 files changed +9
-3
lines changed
Expand file tree Collapse file tree 2 files changed +9
-3
lines changed Original file line number Diff line number Diff line change @@ -2,7 +2,11 @@ name: Build and Publish
22# based on official doc
33# https://packaging.python.org/en/latest/guides/publishing-package-distribution-releases-using-github-actions-ci-cd-workflows/
44
5- on : [push, workflow_dispatch]
5+ on :
6+ push :
7+ tags :
8+ - ' v*'
9+ workflow_dispatch :
610
711jobs :
812 build :
3135
3236 publish-to-pypi :
3337 name : Publish to PyPI
34- if : startsWith(github.ref, 'refs/tags/') # only publish to PyPI on tag pushes # tweak so it doesnt publish all tags
38+ if : startsWith(github.ref, 'refs/tags/') && contains(github.ref_name, 'v') && github.ref_name matches '^v[0-9]+\.[0-9]+\.[0-9]+(\.dev[0-9]+)?$'
3539 needs :
3640 - build
3741 runs-on : ubuntu-22.04
Original file line number Diff line number Diff line change 4040 run : |
4141 git config --global user.name "github-actions[bot]"
4242 git config --global user.email "github-actions[bot]@users.noreply.github.com"
43- git checkout -b generated-docs || git checkout generated-docs
43+ git checkout -b generated-docs
4444 git add .
4545 git commit -m "Update docs for version $GITHUB_REF_NAME [skip ci]" || echo "No changes to commit"
4646 git push origin generated-docs --force
47+ git tag docs/$GITHUB_REF_NAME
48+ git push origin docs/$GITHUB_REF_NAME
You can’t perform that action at this time.
0 commit comments