@@ -33,31 +33,22 @@ Write-Host "Checkout develop branch..."
33
33
git checkout -- quiet develop | Out-Null
34
34
35
35
# ###################
36
- # VS 2017
36
+ # VS 2019 & 2022
37
37
38
- Write-Host " Updating nanoFramework.Tools.MetadataProcessor.MsBuildTask package in VS2017 solution..."
38
+ " ********************************************************************************" | Write-Host
39
+ " Updating nanoFramework.Tools.Debugger.Net package in VS2019 & VS2022 solution..." | Write-Host
39
40
40
- dotnet remove VisualStudio.Extension\VisualStudio.Extension.csproj package nanoFramework.Tools.MetadataProcessor.MsBuildTask
41
+ dotnet remove VisualStudio.Extension- 2019 / VisualStudio.Extension- vs2019.csproj package nanoFramework.Tools.Debugger.Net
42
+ dotnet add VisualStudio.Extension- 2019 / VisualStudio.Extension- vs2019.csproj package nanoFramework.Tools.Debugger.Net -- prerelease
43
+ dotnet remove VisualStudio.Extension- 2022 / VisualStudio.Extension- vs2022.csproj package nanoFramework.Tools.Debugger.Net
44
+ dotnet add VisualStudio.Extension- 2022 / VisualStudio.Extension- vs2022.csproj package nanoFramework.Tools.Debugger.Net -- prerelease
41
45
42
- dotnet add VisualStudio.Extension\VisualStudio.Extension.csproj package nanoFramework.Tools.MetadataProcessor.MsBuildTask - s " https://api.nuget.org/v3/index.json;https://pkgs.dev.azure.com/nanoframework/feed/_packaging/sandbox/nuget/v3/index.json"
43
-
44
- # ###################
45
- # VS 2019
46
-
47
- Write-Host " Updating nanoFramework.Tools.MetadataProcessor.MsBuildTask package in VS2019 solution..."
48
-
49
- dotnet remove VisualStudio.Extension- 2019 \VisualStudio.Extension.csproj package nanoFramework.Tools.MetadataProcessor.MsBuildTask
50
-
51
- dotnet add VisualStudio.Extension- 2019 \VisualStudio.Extension.csproj package nanoFramework.Tools.MetadataProcessor.MsBuildTask - s " https://api.nuget.org/v3/index.json;https://pkgs.dev.azure.com/nanoframework/feed/_packaging/sandbox/nuget/v3/index.json"
52
-
53
- # ####################
54
-
55
- " Bumping MetadataProcessor.MsBuildTask to $packageTargetVersion ." | Write-Host - ForegroundColor Cyan
46
+ " Bumping nanoFramework.Tools.Debugger to $packageTargetVersion ." | Write-Host - ForegroundColor Cyan
56
47
57
48
# build commit message
58
- $commitMessage += " Bumps MetadataProcessor.MsBuildTask to $packageTargetVersion .`n "
49
+ $commitMessage += " Bumps nanoFramework.Tools.Debugger to $packageTargetVersion .`n "
59
50
# build PR title
60
- $prTitle = " Bumps MetadataProcessor.MsBuildTask to $packageTargetVersion "
51
+ $prTitle = " Bumps nanoFramework.Tools.Debugger to $packageTargetVersion "
61
52
62
53
# need this line so nfbot flags the PR appropriately
63
54
$commitMessage += " `n [version update]`n`n "
@@ -67,52 +58,62 @@ $commitMessage += "### :warning: This is an automated update. Merge only after a
67
58
68
59
Write-Debug " Git branch"
69
60
70
- # create branch to perform updates
71
- git branch $newBranchName
61
+ # check if anything was changed
62
+ $repoStatus = " $ ( git status -- short -- porcelain ) "
72
63
73
- Write-Debug " Checkout branch"
64
+ if ($repoStatus -ne " " )
65
+ {
66
+ # create branch to perform updates
67
+ git branch $newBranchName
74
68
75
- # checkout branch
76
- git checkout $newBranchName
69
+ Write-Debug " Checkout branch"
77
70
78
- Write-Debug " Add changes"
71
+ # checkout branch
72
+ git checkout $newBranchName
79
73
80
- # commit changes
81
- git add - A > $null
74
+ Write-Debug " Add changes"
82
75
83
- Write-Debug " Commit changed files"
76
+ # commit changes
77
+ git add - A > $null
84
78
85
- git commit - m " $prTitle ***NO_CI*** " - m " $commitMessage " > $null
79
+ Write-Debug " Commit changed files "
86
80
87
- Write-Debug " Push changes "
81
+ git commit - m " $prTitle ***NO_CI*** " - m " $commitMessage " > $null
88
82
89
- git - c http.extraheader = " AUTHORIZATION: $auth " push -- set-upstream origin $newBranchName > $null
83
+ Write-Debug " Push changes "
90
84
91
- # start PR
92
- # we are hardcoding to 'develop' branch to have a fixed one
93
- # this is very important for tags (which don't have branch information)
94
- # considering that the base branch can be changed at the PR ther is no big deal about this
95
- $prRequestBody = @ {title = " $prTitle " ;body = " $commitMessage " ;head = " $newBranchName " ;base = " develop" } | ConvertTo-Json
96
- $githubApiEndpoint = " https://api.github.com/repos/nanoframework/nf-Visual-Studio-extension/pulls"
97
- [Net.ServicePointManager ]::SecurityProtocol = [Net.SecurityProtocolType ]::Tls12
85
+ git - c http.extraheader= " AUTHORIZATION: $auth " push -- set-upstream origin $newBranchName > $null
98
86
99
- $headers = @ {}
100
- $headers.Add (" Authorization" , " $auth " )
101
- $headers.Add (" Accept" , " application/vnd.github.symmetra-preview+json" )
87
+ # start PR
88
+ # we are hardcoding to 'develop' branch to have a fixed one
89
+ # this is very important for tags (which don't have branch information)
90
+ # considering that the base branch can be changed at the PR ther is no big deal about this
91
+ $prRequestBody = @ {title = " $prTitle " ;body = " $commitMessage " ;head = " $newBranchName " ;base = " develop" } | ConvertTo-Json
92
+ $githubApiEndpoint = " https://api.github.com/repos/nanoframework/nf-Visual-Studio-extension/pulls"
93
+ [Net.ServicePointManager ]::SecurityProtocol = [Net.SecurityProtocolType ]::Tls12
102
94
103
- try
104
- {
105
- $result = Invoke-RestMethod - Method Post - UserAgent [Microsoft.PowerShell.Commands.PSUserAgent ]::InternetExplorer - Uri $githubApiEndpoint - Header $headers - ContentType " application/json" - Body $prRequestBody
106
- ' Started PR with dependencies update...' | Write-Host - NoNewline
107
- ' OK' | Write-Host - ForegroundColor Green
95
+ $headers = @ {}
96
+ $headers.Add (" Authorization" , " $auth " )
97
+ $headers.Add (" Accept" , " application/vnd.github.symmetra-preview+json" )
98
+
99
+ try
100
+ {
101
+ $result = Invoke-RestMethod - Method Post - UserAgent [Microsoft.PowerShell.Commands.PSUserAgent ]::InternetExplorer - Uri $githubApiEndpoint - Header $headers - ContentType " application/json" - Body $prRequestBody
102
+ ' Started PR with dependencies update...' | Write-Host - NoNewline
103
+ ' OK' | Write-Host - ForegroundColor Green
104
+ }
105
+ catch
106
+ {
107
+ $result = $_.Exception.Response.GetResponseStream ()
108
+ $reader = New-Object System.IO.StreamReader($result )
109
+ $reader.BaseStream.Position = 0
110
+ $reader.DiscardBufferedData ()
111
+ $responseBody = $reader.ReadToEnd ();
112
+
113
+ throw " Error starting PR: $responseBody "
114
+ }
108
115
}
109
- catch
116
+ else
110
117
{
111
- $result = $_.Exception.Response.GetResponseStream ()
112
- $reader = New-Object System.IO.StreamReader($result )
113
- $reader.BaseStream.Position = 0
114
- $reader.DiscardBufferedData ()
115
- $responseBody = $reader.ReadToEnd ();
116
-
117
- throw " Error starting PR: $responseBody "
118
+ Write-Host " Nothing udpate at VS extension."
118
119
}
0 commit comments