@@ -133,23 +133,50 @@ jobs:
133133
134134 release :
135135 name : Release project
136- if : github.event_name == 'push' && contains(github.ref, 'refs/tags')
137- needs : [ package ]
136+ if : ${{ github.event_name == 'push' && contains(github.ref, 'refs/tags') }}
137+ needs : [ package, update-changelog ]
138138 runs-on : ubuntu-latest
139+ # Specifying a GitHub environment is optional, but strongly encouraged
140+ environment : release
141+ permissions :
142+ id-token : write
143+ contents : write
139144 steps :
140- - name : Release to the public PyPI repository
141- uses : ansys/ actions/release-pypi-public@v10
145+ - name : " Download the library artifacts from build-library step "
146+ uses : actions/download-artifact@634f93cb2916e3fdff6788551b99b062d0335ce0 # v5.0.0
142147 with :
143- library-name : ${{ env.PACKAGE_NAME }}
144- twine-username : " __token__"
145- twine-token : ${{ secrets.PYPI_TOKEN }}
148+ name : ${{ env.PACKAGE_NAME }}-artifacts
149+ path : ${{ env.PACKAGE_NAME }}-artifacts
150+
151+ - name : " Display structure of downloaded files"
152+ run : ls -Rla
153+
154+ - name : " Release to PyPI using trusted publisher"
155+ uses : pypa/gh-action-pypi-publish@ed0c53931b1dc9bd32cbe73a98c7f6766f8a527e # v1.13.0
156+ with :
157+ repository-url : " https://upload.pypi.org/legacy/"
158+ print-hash : true
159+ packages-dir : ${{ env.PACKAGE_NAME }}-artifacts
160+ skip-existing : false
146161
147- - name : Release to GitHub
148- uses : ansys/actions/release-github@v10
162+ - name : " Release to GitHub"
163+ uses : ansys/actions/release-github@c2fa7c93f6883114e0e643599431b33d29f0b13f # v10.1.4
149164 with :
150165 library-name : ${{ env.PACKAGE_NAME }}
151166 token : ${{ secrets.GITHUB_TOKEN }}
152167
168+ pull-request-name :
169+ if : github.event_name == 'pull_request'
170+ name : Check the name of the pull-request
171+ runs-on : ubuntu-latest
172+ permissions :
173+ pull-requests : read
174+ steps :
175+ - name : Check pull-request name
176+ uses : ansys/actions/check-pr-title@c2fa7c93f6883114e0e643599431b33d29f0b13f # v10.1.4
177+ with :
178+ token : ${{ secrets.GITHUB_TOKEN }}
179+
153180 upload_dev_docs :
154181 name : Upload dev documentation
155182 if : github.ref == 'refs/heads/main'
0 commit comments