@@ -105,32 +105,42 @@ Task("Publish-NuGet-Internal")
105
105
ApiKey = apiKey ,
106
106
Source = apiUrl
107
107
} ) ;
108
+ }
109
+ }
108
110
109
- // Push the package to GitHub Packages
110
- if ( parameters . IsRunningOnGitHubActions ) {
111
- var token = parameters . Credentials . GitHub . Token ;
112
- if ( string . IsNullOrEmpty ( token ) ) {
113
- throw new InvalidOperationException ( "Could not resolve Github token." ) ;
114
- }
115
- var userName = parameters . Credentials . GitHub . UserName ;
116
- if ( string . IsNullOrEmpty ( userName ) ) {
117
- throw new InvalidOperationException ( "Could not resolve Github userName." ) ;
118
- }
111
+ // Push the package to GitHub Packages
112
+ if ( parameters . IsRunningOnGitHubActions )
113
+ {
114
+ Information ( "Publishing nuget to GitHub Packages" ) ;
119
115
120
- var source = $ "https://nuget.pkg.github.com/{ BuildParameters . MainRepoOwner } /index.json";
116
+ var token = parameters . Credentials . GitHub . Token ;
117
+ if ( string . IsNullOrEmpty ( token ) ) {
118
+ throw new InvalidOperationException ( "Could not resolve Github token." ) ;
119
+ }
120
+ var userName = parameters . Credentials . GitHub . UserName ;
121
+ if ( string . IsNullOrEmpty ( userName ) ) {
122
+ throw new InvalidOperationException ( "Could not resolve Github userName." ) ;
123
+ }
121
124
122
- var nugetSourceSettings = new NuGetSourcesSettings
123
- {
124
- UserName = parameters . Credentials . GitHub . UserName ,
125
- Password = token
126
- } ;
125
+ var source = $ "https://nuget.pkg.github.com/{ BuildParameters . MainRepoOwner } /index.json";
127
126
128
- Information ( "Adding NuGet source with user/pass..." ) ;
129
- NuGetAddSource ( "GitHub" , source , nugetSourceSettings ) ;
130
- NuGetPush ( package . PackagePath , new NuGetPushSettings
131
- {
132
- Source = source
133
- } ) ;
127
+ var nugetSourceSettings = new NuGetSourcesSettings
128
+ {
129
+ UserName = userName ,
130
+ Password = token
131
+ } ;
132
+
133
+ Information ( "Adding NuGet source with user/pass..." ) ;
134
+ NuGetAddSource ( "GitHub" , source , nugetSourceSettings ) ;
135
+
136
+ foreach ( var package in parameters . Packages . Nuget )
137
+ {
138
+ if ( FileExists ( package . PackagePath ) )
139
+ {
140
+ NuGetPush ( package . PackagePath , new NuGetPushSettings
141
+ {
142
+ Source = source
143
+ } ) ;
134
144
}
135
145
}
136
146
}
0 commit comments