To create multiple releases for multiple release definitions, you can add PowerShell task to create releases for different release definition by REST API.
The PowerShell script to create a release as below:
$body = '
{
"definitionId": releasedefinitionID,
"artifacts": [
{
"alias": "",
"instanceReference": {
"id": "buildID",
"name": null
}
}
]
}
'
$bodyJson=$body | ConvertFrom-Json
Write-Output $bodyJson
$bodyString=$bodyJson | ConvertTo-Json -Depth 100
Write-Output $bodyString
$user="name"
$token="PAT"
$base64AuthInfo = [Convert]::ToBase64String([Text.Encoding]::ASCII.GetBytes(("{0}:{1}" -f $user,$token)))
$Uri = "https://account.vsrm.visualstudio.com/project/_apis/Release/releases?api-version=4.1-preview.6"
$buildresponse = Invoke-RestMethod -Method Post -UseDefaultCredentials -ContentType application/json -Uri $Uri -Body $bodyString -Headers @{Authorization=("Basic {0}" -f $base64AuthInfo)}
write-host $buildresponse