I’m running into an issue where I am unable to create a release from the REST api for the latest package available from my teamcity nuget feed. I am able to select the last version, but that is no good. Is there some special flag I need to send in the json post to the REST api in order for it to grab the latest nuget package?
So i post
{
“Projectid”: “Projects-82”,
“version”: “0.1.334.102”
}
to hostname/api/releases
with a reply:
{“ErrorMessage”:“There was a problem with your request.”,“Errors”:[“No package version was specified for the step ‘Deploy myProject’”]}
i’m using 3.3.12
So it seems that I am missing something that the request needs. This is why I added the SelectedPackages to the request, but the SelectedPackages does not have a setting for latest only last.
Apologies for my previous mistake. The example I gave you on that github project was for deployment processes without package steps.
To get the latest package version, you need to do a few more REST calls. I’d recommend you to do the following to learn about this:
Open your browser’s developer tools on the “network” tab to see all the http requests that are being made.
Click on the “Create Release” button of your project, and check all the calls that were made to the API to build that page. You’ll notice that some of those calls will get the deployment process, then the package name, then the latest package from the feed. Take note of those to build your script.
Click on “Save” and inspect the full body of the JSON that was sent to the server, which will include the latest version of the package.