File tree Expand file tree Collapse file tree 2 files changed +16
-23
lines changed
Expand file tree Collapse file tree 2 files changed +16
-23
lines changed Original file line number Diff line number Diff line change 11name : " Publish Packages"
22
33on :
4- push :
5- branches : [main]
4+ workflow_call :
5+ inputs :
6+ nuget :
7+ description : ' Whether to publish to NuGet.org'
8+ required : false
9+ type : boolean
10+ default : false
611
712jobs :
813 publish :
2126 run : dotnet pack -c Release --verbosity normal --include-symbols --include-source --version-suffix $GITHUB_RUN_ID --output ./nuget
2227
2328 - name : " Push Packages to GitHub Nuget"
24- run : dotnet nuget push ./nuget/*.nupkg --source https://nuget.pkg.github.com/deveel --api-key ${{ secrets.GITHUB_TOKEN }} --skip-duplicate
29+ run : dotnet nuget push ./nuget/*.nupkg --source https://nuget.pkg.github.com/deveel --api-key ${{ secrets.GITHUB_TOKEN }} --skip-duplicate
30+
31+ - name : " Push Packages to NuGet.org"
32+ if : ${{ inputs.nuget == true }}
33+ run : dotnet nuget push ./nuget/*.nupkg --source https://api.nuget.org/v3/index.json --api-key ${{ secrets.NUGET_API_KEY }} --skip-duplicate
Original file line number Diff line number Diff line change @@ -58,30 +58,14 @@ jobs:
5858 publish :
5959 name : " Publish Packages"
6060 needs : build
61- if : github.ref == 'refs/heads/main'
62- runs-on : ubuntu-latest
63-
64- steps :
65- - uses : actions/checkout@v4
66-
67- - name : " Setup .NET .NET 8.0"
68- uses : actions/setup-dotnet@v4
69- with :
70- dotnet-version : 8.0.x
71-
72- - name : " Pack"
73- run : dotnet pack -c Release --verbosity normal --include-symbols --include-source --version-suffix $GITHUB_RUN_ID --output ./nuget
74-
75- - name : " Push Packages to GitHub Nuget"
76- run : dotnet nuget push ./nuget/*.nupkg --source https://nuget.pkg.github.com/deveel --api-key ${{ secrets.GITHUB_TOKEN }} --skip-duplicate
77-
78- - name : Publish to NuGet
79- run : dotnet nuget push ./nuget/*.nupkg --source https://api.nuget.org/v3/index.json --api-key ${{ secrets.NUGET_API_KEY }} --skip-duplicate
61+ uses : ./.github/workflows/publish-packages.yml
62+ with :
63+ nuget : true
8064
8165 clean :
8266 name : " Cleaning Old Packages"
8367 needs : publish
84- uses : ./.github/workflows/publish -packages.yml
68+ uses : ./.github/workflows/clean -packages.yml
8569
8670 create-release :
8771 name : " Create GitHub Release"
You can’t perform that action at this time.
0 commit comments