Adding pypy notifications and optimizing workflow and parsers (#42)
parent
a753279554
commit
de5faa4d9c
@ -1,37 +0,0 @@
|
|||||||
name: $(date:yyyyMMdd)$(rev:.r)
|
|
||||||
trigger: none
|
|
||||||
pr: none
|
|
||||||
schedules:
|
|
||||||
- cron: "0 8 * * Thu"
|
|
||||||
displayName: Daily build
|
|
||||||
branches:
|
|
||||||
include:
|
|
||||||
- main
|
|
||||||
always: true
|
|
||||||
|
|
||||||
variables:
|
|
||||||
PoolName: 'Azure Pipelines'
|
|
||||||
VmImage: 'ubuntu-18.04'
|
|
||||||
|
|
||||||
stages:
|
|
||||||
- stage: Find_New_Versions
|
|
||||||
dependsOn: []
|
|
||||||
jobs:
|
|
||||||
- job: Find_New_Versions
|
|
||||||
pool:
|
|
||||||
name: $(PoolName)
|
|
||||||
vmImage: $(VmImage)
|
|
||||||
steps:
|
|
||||||
- template: /azure-pipelines/templates/get-tool-versions-steps.yml
|
|
||||||
|
|
||||||
- stage: Check_New_Versions
|
|
||||||
dependsOn: Find_New_Versions
|
|
||||||
jobs:
|
|
||||||
- job: Check_New_Versions
|
|
||||||
pool:
|
|
||||||
name: $(PoolName)
|
|
||||||
vmImage: $(VmImage)
|
|
||||||
variables:
|
|
||||||
ToolVersions: $[ stageDependencies.Find_New_Versions.Find_New_Versions.outputs['Get_versions.TOOL_VERSIONS'] ]
|
|
||||||
steps:
|
|
||||||
- template: /azure-pipelines/templates/check-versions.yml
|
|
@ -0,0 +1,21 @@
|
|||||||
|
function Search-PythonVersionsNotOnImage {
|
||||||
|
param (
|
||||||
|
[string]$ToolName,
|
||||||
|
[string]$ReleasesUrl,
|
||||||
|
[string]$FilterParameter,
|
||||||
|
[string]$FilterArch
|
||||||
|
)
|
||||||
|
|
||||||
|
$stableReleases = (Invoke-RestMethod $ReleasesUrl) |
|
||||||
|
Where-Object stable -eq $true |
|
||||||
|
ForEach-Object {$_.$FilterParameter.split(".")[0,1] -join"."} |
|
||||||
|
Select-Object -Unique
|
||||||
|
$toolsetUrl = "https://raw.githubusercontent.com/actions/virtual-environments/main/images/win/toolsets/toolset-2022.json"
|
||||||
|
$latestVersion = ((Invoke-RestMethod $toolsetUrl).toolcache |
|
||||||
|
Where-Object {$_.name -eq $ToolName -and $_.arch -eq $FilterArch}).versions |
|
||||||
|
Select-Object -Last 1
|
||||||
|
$latestMinorVesion = $latestVersion.TrimEnd(".*")
|
||||||
|
$versionsToAdd = $stableReleases | Where-Object {[version]$_ -gt [version]$latestMinorVesion}
|
||||||
|
|
||||||
|
return $versionsToAdd
|
||||||
|
}
|
@ -0,0 +1,19 @@
|
|||||||
|
function Search-XamarinVersionsNotOnImage {
|
||||||
|
param (
|
||||||
|
[string]$ReleasesUrl,
|
||||||
|
[array]$FilterProducts
|
||||||
|
)
|
||||||
|
|
||||||
|
$xamarinReleases = (Invoke-RestMethod $ReleasesUrl).items
|
||||||
|
$filteredReleases = $xamarinReleases | Where-Object {$_.name -in $FilterProducts.name} | Sort-Object name | Select-Object name, version
|
||||||
|
$toolsetUrl = "https://raw.githubusercontent.com/actions/virtual-environments/main/images/macos/toolsets/toolset-11.json"
|
||||||
|
$uploadedReleases = (Invoke-RestMethod $toolsetUrl).xamarin
|
||||||
|
$releasesOnImage = @()
|
||||||
|
foreach ($FilterProduct in $FilterProducts) {
|
||||||
|
$releasesOnImage += @{$FilterProduct.name = $uploadedReleases.($FilterProduct.property)}
|
||||||
|
}
|
||||||
|
$versionsToAdd = $filteredReleases | Where-Object {$releasesOnImage.($_.name) -notcontains $_.version} | ForEach-Object {[string]::Empty} {
|
||||||
|
'{0,-15} : {1}' -f $_.name, $_.version
|
||||||
|
}
|
||||||
|
return $versionsToAdd
|
||||||
|
}
|
@ -1,30 +0,0 @@
|
|||||||
using module "./base-parser.psm1"
|
|
||||||
|
|
||||||
class XamarinVersionsParser: BaseVersionsParser {
|
|
||||||
[PSCustomObject] GetAvailableVersions() {
|
|
||||||
$allVersions = $this.ParseAllAvailableVersions()
|
|
||||||
return $allVersions
|
|
||||||
}
|
|
||||||
|
|
||||||
[hashtable] GetUploadedVersions() {
|
|
||||||
$url = $this.BuildGitHubFileUrl("actions", "virtual-environments", "main", "images/macos/toolsets/toolset-11.json")
|
|
||||||
$releases = Invoke-RestMethod $url -MaximumRetryCount $this.ApiRetryCount -RetryIntervalSec $this.ApiRetryIntervalSeconds
|
|
||||||
$xamarin = $releases.xamarin
|
|
||||||
$xamarinReleases = @{
|
|
||||||
'Mono Framework' = $xamarin.'mono-versions'
|
|
||||||
'Xamarin.Android' = $xamarin.'android-versions'
|
|
||||||
'Xamarin.iOS' = $xamarin.'ios-versions'
|
|
||||||
'Xamarin.Mac' = $xamarin.'mac-versions'
|
|
||||||
}
|
|
||||||
return $xamarinReleases
|
|
||||||
}
|
|
||||||
|
|
||||||
hidden [PSCustomObject] ParseAllAvailableVersions() {
|
|
||||||
$url = "http://aka.ms/manifest/stable"
|
|
||||||
$filteredProducts = @('Mono Framework', 'Xamarin.Android', 'Xamarin.iOS', 'Xamarin.Mac')
|
|
||||||
$releases = Invoke-RestMethod $url -MaximumRetryCount $this.ApiRetryCount -RetryIntervalSec $this.ApiRetryIntervalSeconds
|
|
||||||
$items = $releases.items
|
|
||||||
$products = $items | Where-Object {$_.name -in $filteredProducts} | Sort-Object name | Select-Object name, version
|
|
||||||
return $products
|
|
||||||
}
|
|
||||||
}
|
|
Loading…
Reference in New Issue