mirror of
https://github.com/actions/versions-package-tools.git
synced 2025-12-11 03:56:46 +00:00
test
This commit is contained in:
@@ -32,7 +32,7 @@ stages:
|
|||||||
|
|
||||||
- stage: Trigger_Builds
|
- stage: Trigger_Builds
|
||||||
dependsOn: Get_New_Versions
|
dependsOn: Get_New_Versions
|
||||||
condition: and(succeeded(), ne(stageDependencies.Get_New_Versions.Get_Tool_Versions.outputs['Get_versions.TOOL_VERSIONS'], ''))
|
condition: and(succeeded(), ne(stageDependencies.Get_New_Versions.Get_Tool_Versions.outputs['Get_versions.TOOL_VERSIONS'], ''), ne(variables['WORKFLOW_FILE_NAME'], ''))
|
||||||
jobs:
|
jobs:
|
||||||
- deployment: Run_Builds
|
- deployment: Run_Builds
|
||||||
pool:
|
pool:
|
||||||
|
|||||||
@@ -8,37 +8,33 @@ steps:
|
|||||||
arguments: |
|
arguments: |
|
||||||
-ToolName "$(TOOL_NAME)"
|
-ToolName "$(TOOL_NAME)"
|
||||||
|
|
||||||
# - task: PowerShell@2
|
|
||||||
# displayName: 'Cancel build'
|
|
||||||
# condition: and(succeeded(), eq(variables['Get_versions.TOOL_VERSIONS'], ''))
|
|
||||||
# inputs:
|
|
||||||
# TargetType: inline
|
|
||||||
# script: |
|
|
||||||
# Import-Module "./azure-devops/azure-devops-api.ps1"
|
|
||||||
# $azureDevOpsApi = Get-AzureDevOpsApi -TeamFoundationCollectionUri $(System.TeamFoundationCollectionUri) `
|
|
||||||
# -ProjectName $(System.TeamProject) `
|
|
||||||
# -AccessToken $(System.AccessToken)
|
|
||||||
|
|
||||||
# $AzureDevOpsApi.UpdateBuildStatus($(Build.BuildId), 'Cancelling') | Out-Null
|
|
||||||
|
|
||||||
- task: PowerShell@2
|
- task: PowerShell@2
|
||||||
displayName: 'Set env variable'
|
displayName: 'Set env variable'
|
||||||
condition: and(succeeded(), ne(variables['Get_versions.TOOL_VERSIONS'], ''))
|
condition: and(succeeded(), ne(variables['TOOL_NAME'], "Python"))
|
||||||
inputs:
|
inputs:
|
||||||
TargetType: inline
|
TargetType: inline
|
||||||
script: |
|
script: |
|
||||||
$PipelineUrl = "$(System.TeamFoundationCollectionUri)$(System.TeamProject)/_build/results?buildId=$(Build.BuildId)"
|
$PipelineUrl = "$(System.TeamFoundationCollectionUri)$(System.TeamProject)/_build/results?buildId=$(Build.BuildId)"
|
||||||
Write-Output "##vso[task.setvariable variable=PIPELINE_URL]$PipelineUrl"
|
Write-Host "##vso[task.setvariable variable=PIPELINE_URL]$PipelineUrl"
|
||||||
|
|
||||||
# - task: PowerShell@2
|
- task: PowerShell@2
|
||||||
# displayName: 'Send Slack notification'
|
displayName: 'Change build name'
|
||||||
# condition: and(succeeded(), ne(variables['Get_versions.TOOL_VERSIONS'], ''))
|
condition: and(succeeded(), ne(variables['Get_versions.TOOL_VERSIONS'], ''))
|
||||||
# inputs:
|
inputs:
|
||||||
# targetType: filePath
|
TargetType: inline
|
||||||
# filePath: './get-new-tool-versions/send-slack-notification.ps1'
|
script: |
|
||||||
# arguments: |
|
$newBuildName = "[FOUND] $(Build.BuildNumber)"
|
||||||
# -Url "$(SLACK_CHANNEL_URL)" `
|
Write-Host "##vso[build.updatebuildnumber]$newBuildName"
|
||||||
# -ToolName "$(TOOL_NAME)" `
|
|
||||||
# -ToolVersion "$(Get_versions.TOOL_VERSIONS)" `
|
- task: PowerShell@2
|
||||||
# -PipelineUrl "$(PIPELINE_URL)" `
|
displayName: 'Send Slack notification'
|
||||||
# -ImageUrl "$(IMAGE_URL)"
|
condition: and(succeeded(), ne(variables['Get_versions.TOOL_VERSIONS'], ''))
|
||||||
|
inputs:
|
||||||
|
targetType: filePath
|
||||||
|
filePath: './get-new-tool-versions/send-slack-notification.ps1'
|
||||||
|
arguments: |
|
||||||
|
-Url "$(SLACK_CHANNEL_URL)" `
|
||||||
|
-ToolName "$(TOOL_NAME)" `
|
||||||
|
-ToolVersion "$(Get_versions.TOOL_VERSIONS)" `
|
||||||
|
-PipelineUrl "$(PIPELINE_URL)" `
|
||||||
|
-ImageUrl "$(IMAGE_URL)"
|
||||||
|
|||||||
@@ -37,7 +37,7 @@ if ($VersionsToBuild) {
|
|||||||
$availableVersions = $VersionsToBuild -join ","
|
$availableVersions = $VersionsToBuild -join ","
|
||||||
$toolVersions = $availableVersions.Replace(",",", ")
|
$toolVersions = $availableVersions.Replace(",",", ")
|
||||||
Write-Host "The following versions are available to build:`n$toolVersions"
|
Write-Host "The following versions are available to build:`n$toolVersions"
|
||||||
Write-Output "##vso[task.setvariable variable=TOOL_VERSIONS;isOutput=true]$toolVersions"
|
Write-Host "##vso[task.setvariable variable=TOOL_VERSIONS;isOutput=true]$toolVersions"
|
||||||
} else {
|
} else {
|
||||||
Write-Host "There aren't versions to build"
|
Write-Host "There aren't versions to build"
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -27,10 +27,7 @@ param(
|
|||||||
[ValidateNotNullOrEmpty()]
|
[ValidateNotNullOrEmpty()]
|
||||||
[System.String]$ToolVersion,
|
[System.String]$ToolVersion,
|
||||||
|
|
||||||
[Parameter(Mandatory)]
|
|
||||||
[ValidateNotNullOrEmpty()]
|
|
||||||
[System.String]$PipelineUrl,
|
[System.String]$PipelineUrl,
|
||||||
|
|
||||||
[System.String]$ImageUrl = 'https://github.githubassets.com/images/modules/logos_page/GitHub-Mark.png'
|
[System.String]$ImageUrl = 'https://github.githubassets.com/images/modules/logos_page/GitHub-Mark.png'
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -38,7 +35,10 @@ param(
|
|||||||
Import-Module $PSScriptRoot/helpers.psm1 -DisableNameChecking
|
Import-Module $PSScriptRoot/helpers.psm1 -DisableNameChecking
|
||||||
|
|
||||||
# Create JSON body
|
# Create JSON body
|
||||||
$text = "The following versions of '$toolName' are available to upload: $toolVersion\nLink to the pipeline: $pipelineUrl"
|
$text = "The following versions of '$toolName' are available to upload: $toolVersion"
|
||||||
|
if ($PipelineUrl) {
|
||||||
|
$text += "\nLink to the pipeline: $pipelineUrl"
|
||||||
|
}
|
||||||
$jsonBodyMessage = @"
|
$jsonBodyMessage = @"
|
||||||
{
|
{
|
||||||
"blocks": [
|
"blocks": [
|
||||||
|
|||||||
Reference in New Issue
Block a user