-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathcheckMissingArtifacts.ps1
55 lines (48 loc) · 1.45 KB
/
checkMissingArtifacts.ps1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
$rootdir = Split-Path -Parent $MyInvocation.MyCommand.Definition
$artifactsdir = "${rootdir}/artifacts"
if (!(Test-Path "${artifactsdir}")) {
Write-Host "no artifacts found"
exit
}
$arches = (Get-Content "${artifactsdir}/runtime.supported.json") | ConvertFrom-Json
function Check-Arch($path) {
$segment = $path.Split("/")
$version = $segment[($segment.Count - 1)]
foreach ($arch in $arches) {
if ($arch -eq "win-arm64") {
if ($version -match "^v1") {
continue
}
if ($version -match "^v2") {
continue
}
if ($version -match "^v3") {
continue
}
if ($version -match "^v5") {
continue
}
} elseif ($arch -eq "osx-arm64") {
if ($version -match "^v1") {
continue
}
if ($version -match "^v2") {
continue
}
if ($version -match "^v3") {
continue
}
if ($version -match "^v5") {
continue
}
}
if (!(Test-Path "${path}/${arch}.Release") -or !(Get-ChildItem "${path}/${arch}.Release").Length) {
Write-Host "${version} does not contain arch ${arch}"
}
}
}
Get-ChildItem $artifactsdir | ForEach-Object -Process {
if ($_.psiscontainer) {
Check-Arch -Path "${artifactsdir}/$($_.Name)"
}
}