Merge pull request #25 from actions/al-cheb/add-xamarin-tool
Add xamarin tool version checkpull/31/head
commit
ab218c2436
@ -0,0 +1,37 @@
|
||||
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,30 @@
|
||||
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.0.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