forked from actions/runner-images
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* add release step * add creation release * move file to another folder * resolve comments * minor changes
- Loading branch information
1 parent
779cef9
commit 56bc081
Showing
2 changed files
with
43 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
param( | ||
[UInt32] [Parameter (Mandatory)] $BuildId, | ||
[String] [Parameter (Mandatory)] $Organization, | ||
[String] [Parameter (Mandatory)] $Project, | ||
[String] [Parameter (Mandatory)] $ImageName, | ||
[String] [Parameter (Mandatory)] $DefinitionId, | ||
[String] [Parameter (Mandatory)] $AccessToken | ||
) | ||
|
||
$Body = @{ | ||
definitionId = $DefinitionId | ||
variables = @{ | ||
ImageBuildId = @{ | ||
value = $BuildId | ||
} | ||
ImageName = @{ | ||
value = $ImageName | ||
} | ||
} | ||
isDraft = "false" | ||
} | ConvertTo-Json -Depth 3 | ||
|
||
$URL = "https://vsrm.dev.azure.com/$Organization/$Project/_apis/release/releases?api-version=5.1" | ||
$base64AuthInfo = [Convert]::ToBase64String([Text.Encoding]::ASCII.GetBytes("'':${AccessToken}")) | ||
$headers = @{ | ||
Authorization = "Basic ${base64AuthInfo}" | ||
} | ||
|
||
$NewRelease = Invoke-RestMethod $URL -Body $Body -Method "POST" -Headers $headers -ContentType "application/json" | ||
|
||
Write-Host "Created release: $($NewRelease._links.web.href)" |