tag:help.appveyor.com,2012-11-13:/discussions/questions/30558-multi-platform-nuget-packingAppVeyor: Discussion 2019-01-28T21:00:32Ztag:help.appveyor.com,2012-11-13:Comment/465496282018-11-26T16:06:14Z2018-11-26T16:06:14ZMulti-platform Nuget Packing<div><p>I'm not sure exactly what you mean by 'aggregate build results' but if you are publishing nuget packages from a project with multiple jobs, <a href="https://www.appveyor.com/docs/nuget/#account-nuget-feed">this section</a> of the docs may be relevant to you.</p></div>Owen McDonnelltag:help.appveyor.com,2012-11-13:Comment/465496282018-11-27T09:06:08Z2018-11-27T20:45:32ZMulti-platform Nuget Packing<div><p>Thanks for your reply.<br>
I saw that section and it seems Appveyor makes it quite easy to publish Nugets.<br>
But doesn't that generate one Nuget per job ? In my case I'm afraid I'd end up with as many as 6 packages ( [2013,2015,2017] x [x86,x64] ) while everything could be contained in only one Nuget.<br>
That's what I meant with aggregate the build results, merging the binaries compiled by several jobs into one package.</p></div>paolo20000tag:help.appveyor.com,2012-11-13:Comment/465496282018-11-28T01:26:27Z2018-11-28T01:26:27ZMulti-platform Nuget Packing<div><p>My colleague created <a href="https://gist.github.com/IlyaFinkelshteyn/dc0b08593cb0babff2bd84dd05c4ee42">this script</a> which could be used in this situation.<br>
I've adapted it a little below. Of course, the timeout is not really necessary if you prefer to just have maximum build time be the timeout. Also, note that the <code>APPVEYOR_BUILD_NUMBER</code> would need to change if you add any jobs to the matrix.</p>
<pre>
<code>image:
- Visual Studio 2017
- Visual Studio 2015
- Visual Studio 2013
platform:
- x86
- x64
environment:
ApiKey:
secure: SlDEDtAKuvsy+VErEuc/4DxdhPeKu2WRqvYzEh/fiH4=
TimeOutMins: 20
after_build:
- <your-packaging-scripts>
- ps: |
if ($env:APPVEYOR_JOB_NUMBER -eq 6) {
$headers = @{
"Authorization" = "Bearer $ApiKey"
"Content-type" = "application/json"
}
[datetime]$stop = ([datetime]::Now).AddMinutes($env:TimeOutMins)
[bool]$success = $false
while(!$success -and ([datetime]::Now) -lt $stop) {
$project = Invoke-RestMethod -Uri "https://ci.appveyor.com/api/projects/$env:APPVEYOR_ACCOUNT_NAME/$env:APPVEYOR_PROJECT_SLUG" -Headers $headers -Method GET
foreach ($job in $project.build.jobs) {
if ($job.status -eq "success") {continue}
}
$success = $true
}
if (!$success) {throw "Jobs were not finished in $env:TimeOutMins minutes"}
foreach ($job in $filteredJobs) {
Start-FileDownload https://ci.appveyor.com/api/buildjobs/$job.jobId/artifacts/<your-build-artifact> <artifact-name>
}
}</code>
</pre></div>Owen McDonnell