1
+ # Copyright (c) .NET Foundation and Contributors
2
+ # See LICENSE file in the project root for full license information.
3
+
1
4
" Updating dependents of nano-debugger" | Write-Host
2
5
3
6
# compute authorization header in format "AUTHORIZATION: basic 'encoded token'"
@@ -14,12 +17,14 @@ $prTitle = ""
14
17
$newBranchName = " develop-nfbot/update-dependencies/" + [guid ]::NewGuid().ToString()
15
18
$packageTargetVersion = gh release view -- json tagName -- jq .tagName
16
19
$packageTargetVersion = $packageTargetVersion -replace " v"
20
+ $packageName = " nanoframework.tools.debugger.net"
21
+ $repoMainBranch = " main"
17
22
18
23
# working directory is agent temp directory
19
24
Write-Debug " Changing working directory to $env: Agent_TempDirectory "
20
25
Set-Location " $env: Agent_TempDirectory " | Out-Null
21
26
22
- # clone repo and checkout develop branch
27
+ # clone repo and checkout
23
28
Write-Debug " Init and featch nf-Visual-Studio-extension repo"
24
29
25
30
# ###################
@@ -35,8 +40,34 @@ git config --global user.name nfbot
35
40
git config -- global user.email nanoframework@outlook.com
36
41
git config -- global core.autocrlf true
37
42
38
- Write-Host " Checkout develop branch..."
39
- git checkout -- quiet develop | Out-Null
43
+ Write-Host " Checkout $repoMainBranch branch..."
44
+ git checkout -- quiet $repoMainBranch | Out-Null
45
+
46
+ # check if nuget package is already available from nuget.org
47
+ $nugetApiUrl = " https://api.nuget.org/v3-flatcontainer/$packageName /index.json"
48
+
49
+ function Get-LatestNugetVersion {
50
+ param (
51
+ [string ]$url
52
+ )
53
+ try {
54
+ $response = Invoke-RestMethod - Uri $url - Method Get
55
+ return $response.versions [-1 ]
56
+ }
57
+ catch {
58
+ throw " Error querying NuGet API: $_ "
59
+ }
60
+ }
61
+
62
+ $latestNugetVersion = Get-LatestNugetVersion - url $nugetApiUrl
63
+
64
+ while ($latestNugetVersion -ne $packageTargetVersion ) {
65
+ Write-Host " Latest version still not available from nuget.org feed. Waiting 5 minutes..."
66
+ Start-Sleep - Seconds 300
67
+ $latestNugetVersion = Get-LatestNugetVersion - url $nugetApiUrl
68
+ }
69
+
70
+ Write-Host " Version $latestNugetVersion available from nuget.org feed. Proceeding with update."
40
71
41
72
dotnet restore
42
73
dotnet remove VisualStudio.Extension- 2019 / VisualStudio.Extension- vs2019.csproj package nanoFramework.Tools.Debugger.Net
0 commit comments