77
88on :
99 push :
10- branches :
11- - main
12- - master
10+ # branches:
11+ # - main
12+ # - master
1313 tags :
1414 - " *"
1515 pull_request :
@@ -191,6 +191,7 @@ jobs:
191191 release :
192192 name : Release
193193 runs-on : ubuntu-latest
194+ environment : pypi_api_token
194195 if : ${{ startsWith(github.ref, 'refs/tags/') || github.event_name ==
195196 ' workflow_dispatch' }}
196197 needs : [ linux, musllinux, windows, macos, sdist ]
@@ -207,19 +208,20 @@ jobs:
207208 uses : actions/attest-build-provenance@v3
208209 with :
209210 subject-path : " wheels-*/*"
210- # - name: Install uv
211- # if: ${{ startsWith(github.ref, 'refs/tags/') }}
212- # uses: astral-sh/setup-uv@v7
213- # - name: Publish to PyPI
214- # if: ${{ startsWith(github.ref, 'refs/tags/') }}
215- # run: uv publish 'wheels-*/*'
216- - name : Create GitHub Release
217- uses : softprops/action-gh-release@v2
218- if : startsWith(github.ref, 'refs/tags/')
219- with :
220- # 同样使用通配符,确保抓取所有子文件夹里的 whl 和 sdist
221- files : wheels-*/*
222- generate_release_notes : true
211+ - name : Install uv
212+ if : ${{ startsWith(github.ref, 'refs/tags/') }}
213+ uses : astral-sh/setup-uv@v7
214+ - name : Publish to PyPI
215+ if : ${{ startsWith(github.ref, 'refs/tags/') }}
216+ run : uv publish 'wheels-*/*'
217+
218+ # - name: Create GitHub Release
219+ # uses: softprops/action-gh-release@v2
220+ # if: startsWith(github.ref, 'refs/tags/')
221+ # with:
222+ # # 同样使用通配符,确保抓取所有子文件夹里的 whl 和 sdist
223+ # files: wheels-*/*
224+ # generate_release_notes: true
223225 env :
224- GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
225- # UV_PUBLISH_TOKEN: ${{ secrets.PYPI_API_TOKEN }}
226+ # GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
227+ UV_PUBLISH_TRUSTED_PUBLISHER : " true "
0 commit comments