@@ -3,6 +3,13 @@ name: "Publish package and documentation"
33on :
44 release :
55 types : ["published"]
6+ workflow_dispatch :
7+ inputs :
8+ is_test :
9+ description : ' Indicates that the run should publish to the test repositories'
10+ required : false
11+ type : boolean
12+ default : false
613
714jobs :
815 packages :
@@ -22,16 +29,16 @@ jobs:
2229 with :
2330 enable-cache : true
2431
25- - name : Build
26- run : uv build
32+ - name : Build package
33+ run : make build
2734
28- - name : Publish RC packages to PyPI Test
29- if : contains( github.event.release.tag_name, '-rc')
35+ - name : Publish packages to PyPI Test
36+ if : ${{ github.event.inputs.run_deploy == 'true' }}
3037 run : |
3138 uv publish --index testpypi --token ${{ secrets.TEST_PYPI_TOKEN }}
3239
3340 - name : Publish release packages to PyPI
34- if : ${{ ! contains( github.event.release.tag_name, '-rc') }}
41+ if : ${{ github.event.inputs.run_deploy == 'false' }}
3542 run : uv publish --token ${{ secrets.PYPI_TOKEN }}
3643
3744 docs :
@@ -50,19 +57,19 @@ jobs:
5057 enable-cache : true
5158
5259 - name : Generate docs
53- run : make install generate-docs
60+ run : make generate-docs
5461
55- - name : Publish RC docs
56- if : contains( github.event.release.tag_name, '-rc')
62+ - name : Publish release docs to test location
63+ if : ${{ github.event.inputs.run_deploy == 'true' }}
5764 uses : peaceiris/actions-gh-pages@v4
5865 with :
5966 github_token : ${{ secrets.GITHUB_TOKEN }}
6067 publish_dir : ./docs
6168 # this puts the docs for this tag under gh-pages:/rc/<tag>/
6269 destination_dir : rc/${{ github.event.release.tag_name }}
6370
64- - name : Publish release docs
65- if : ${{ ! contains( github.event.release.tag_name, '-rc') }}
71+ - name : Publish release docs to production location
72+ if : ${{ github.event.inputs.run_deploy == 'false' }}
6673 uses : peaceiris/actions-gh-pages@v4
6774 with :
6875 github_token : ${{ secrets.GITHUB_TOKEN }}
0 commit comments