Skip to content

Commit 22e4a4d

Browse files
committed
ci(release): 合并 NuGet 发布步骤到 release 工作流
将 publish-nuget.yml 的功能合并到 release.yml 中,解决 GITHUB_TOKEN 推送 tag 不触发其他工作流的问题。
1 parent 59ea173 commit 22e4a4d

2 files changed

Lines changed: 8 additions & 43 deletions

File tree

.github/workflows/publish-nuget.yml

Lines changed: 0 additions & 43 deletions
This file was deleted.

.github/workflows/release.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,14 @@ jobs:
8888
env:
8989
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
9090

91+
- name: Pack NuGet packages
92+
if: steps.check.outputs.need_release == 'true'
93+
run: dotnet pack --configuration Release --output ./artifacts
94+
95+
- name: Publish to NuGet
96+
if: steps.check.outputs.need_release == 'true'
97+
run: dotnet nuget push ./artifacts/*.nupkg --api-key ${{ secrets.NUGET_API_KEY }} --source https://api.nuget.org/v3/index.json --skip-duplicate
98+
9199
- name: Push changes
92100
if: steps.check.outputs.need_release == 'true'
93101
run: |

0 commit comments

Comments
 (0)