File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -44,13 +44,13 @@ jobs:
4444 echo "Generated client file found and verified"
4545
4646 - name : Pack
47- run : dotnet pack ${{ env.PROJECT_PATH }} --no-build --configuration Release
47+ run : dotnet pack ${{ env.PROJECT_PATH }} --no-build --configuration Release --output ./nupkg
4848
4949 - name : Upload build artifacts
5050 uses : actions/upload-artifact@v4
5151 with :
5252 name : nuget-package
53- path : TypescriptClientGenerator/bin/Release /*.nupkg
53+ path : ./nupkg /*.nupkg
5454
5555 publish :
5656 needs : build-and-test
@@ -85,22 +85,25 @@ jobs:
8585 run : dotnet build ${{ env.PROJECT_PATH }} --no-restore --configuration Release -p:Version=${{ steps.gitversion.outputs.semVer }}
8686
8787 - name : Pack
88- run : dotnet pack ${{ env.PROJECT_PATH }} --no-build --configuration Release -p:PackageVersion=${{ steps.gitversion.outputs.semVer }}
88+ run : dotnet pack ${{ env.PROJECT_PATH }} --no-build --configuration Release -p:PackageVersion=${{ steps.gitversion.outputs.semVer }} --output ./nupkg
8989
9090 - name : Publish to NuGet
91- if : ${{ secrets.NUGET_API_KEY != '' }}
9291 env :
9392 NUGET_API_KEY : ${{ secrets.NUGET_API_KEY }}
9493 run : |
95- for package in TypescriptClientGenerator/bin/Release/*.nupkg; do
94+ if [ -z "$NUGET_API_KEY" ]; then
95+ echo "NUGET_API_KEY secret is not set. Skipping publish."
96+ exit 0
97+ fi
98+ for package in ./nupkg/*.nupkg; do
9699 dotnet nuget push "$package" --api-key "$NUGET_API_KEY" --source https://api.nuget.org/v3/index.json --skip-duplicate
97100 done
98101
99102 - name : Upload release artifacts
100103 uses : actions/upload-artifact@v4
101104 with :
102105 name : release-package
103- path : TypescriptClientGenerator/bin/Release /*.nupkg
106+ path : ./nupkg /*.nupkg
104107
105108 verify-package :
106109 needs : build-and-test
You can’t perform that action at this time.
0 commit comments