5959 needs :
6060 - test
6161 concurrency : release
62- if : github.ref == 'refs/heads/main'
6362 permissions :
6463 contents : write
6564 issues : write
@@ -69,27 +68,25 @@ jobs:
6968 packages : write
7069 environment :
7170 name : release
72-
71+
7372 steps :
74- - uses : actions/checkout@v4
75- with :
76- fetch-depth : 0
77- persist-credentials : false
78- - name : Python Semantic Release
79- id : release
80- uses : python-semantic-release/python-semantic-release@v9.14.0
81- with :
82- github_token : ${{ secrets.DEPLOY_KEY }}
83-
84- - name : Publish package distributions to PyPI
85- uses : pypa/gh-action-pypi-publish@v1.12.2
86-
87- # NOTE: DO NOT wrap the conditional in ${{ }} as it will always evaluate to true.
88- # See https://github.com/actions/runner/issues/1173
89- if : steps.release.outputs.released == 'true'
90-
91- - name : Publish package distributions to GitHub Releases
92- uses : python-semantic-release/upload-to-gh-release@v8.7.0
93- if : steps.release.outputs.released == 'true'
94- with :
95- github_token : ${{ secrets.DEPLOY_KEY }}
73+ - uses : actions/checkout@v4
74+ with :
75+ fetch-depth : 0
76+ persist-credentials : false
77+
78+ - name : Python Semantic Release
79+ id : release
80+ uses : python-semantic-release/python-semantic-release@v9.14.0
81+ with :
82+ github_token : ${{ secrets.GH_TOKEN }}
83+ root_options : ${{ github.ref != 'refs/heads/main' && '-vv --noop' || '-vv' }}
84+
85+ - name : Publish package distributions to PyPI
86+ uses : pypa/gh-action-pypi-publish@v1.12.2
87+ if : github.ref == 'refs/heads/main' && steps.release.outputs.released == 'true'
88+
89+ - name : Publish package distributions to GitHub Releases
90+ uses : python-semantic-release/upload-to-gh-release@v8.7.0
91+ if : github.ref == 'refs/heads/main' && steps.release.outputs.released == 'true'
92+
0 commit comments