Skip to content

Commit 430c5f7

Browse files
committed
Work CD-CI
- Fix access to pipeline secret var. - Fix nuget update cmd. - Improve console output. ***NO_CI*** Signed-off-by: josesimoes <[email protected]>
1 parent c6b7224 commit 430c5f7

File tree

2 files changed

+16
-10
lines changed

2 files changed

+16
-10
lines changed

azure-pipelines.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,9 @@ jobs:
156156
- task: PowerShell@2
157157
inputs:
158158
targetType: filePath
159-
filePath: source/azure-pipelines/update-dependencies.ps1
159+
filePath: azure-pipelines/update-dependencies.ps1
160+
env:
161+
MY_GITHUB_TOKEN: $(GitHubToken)
160162
condition: or( and( succeeded(), contains(variables['Build.SourceVersionMessage'], '***UPDATE_DEPENDENTS***') ), eq(variables['UPDATE_DEPENDENTS'], 'true') )
161163
displayName: Update dependent class libs
162164

source/azure-pipelines/update-dependencies.ps1

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
# compute authorization header in format "AUTHORIZATION: basic 'encoded token'"
44
# 'encoded token' is the Base64 of the string "nfbot:personal-token"
5-
$auth = "basic $([System.Convert]::ToBase64String([System.Text.Encoding]::UTF8.GetBytes("nfbot:$(GitHubToken)"))))"
5+
$auth = "basic $([System.Convert]::ToBase64String([System.Text.Encoding]::UTF8.GetBytes("nfbot:$env:MY_GITHUB_TOKEN"))))"
66

77
# because it can take sometime for the package to become available on the NuGet providers
88
# need to hang here for 2 minutes (2 * 60)
@@ -38,24 +38,28 @@ Set-Location source | Out-Null
3838
####################
3939
# VS 2017
4040

41+
Write-Host "Restoring packages in VS2017 solution..."
42+
4143
# restore NuGet packages, need to do this before anything else
42-
nuget restore nanoFramework.Tools.VisualStudio.sln -Source https://pkgs.dev.azure.com/nanoframework/feed/_packaging/sandbox/nuget/v3/index.json -Source https://api.nuget.org/v3/index.json
44+
nuget restore nanoFramework.Tools.VisualStudio.sln -ConfigFile NuGet.Config
4345

44-
Write-Debug "Updating packages in VS2017 solution"
46+
Write-Host "Updating nanoFramework.Tools.MetadataProcessor.Core package in VS2017 solution..."
4547

46-
nuget update -Id nanoFramework.Tools.MetadataProcessor.Core Tools.BuildTasks\Tools.BuildTasks.csproj -ConfigFile NuGet.Config
47-
nuget update -Id nanoFramework.Tools.MetadataProcessor.Core VisualStudio.Extension\VisualStudio.Extension.csproj -ConfigFile NuGet.Config
48+
nuget update -Id nanoFramework.Tools.MetadataProcessor.Core Tools.BuildTasks\Tools.BuildTasks.csproj -ConfigFile NuGet.Config -PreRelease
49+
nuget update -Id nanoFramework.Tools.MetadataProcessor.Core VisualStudio.Extension\VisualStudio.Extension.csproj -ConfigFile NuGet.Config -PreRelease
4850

4951
####################
5052
# VS 2019
5153

54+
Write-Host "Restoring packages in VS2019 solution..."
55+
5256
# restore NuGet packages, need to do this before anything else
53-
nuget restore nanoFramework.Tools.VisualStudio-2019.sln -Source https://pkgs.dev.azure.com/nanoframework/feed/_packaging/sandbox/nuget/v3/index.json -Source https://api.nuget.org/v3/index.json
57+
nuget restore nanoFramework.Tools.VisualStudio-2019.sln -ConfigFile NuGet.Config
5458

55-
Write-Debug "Updating packages in VS2019 solution"
59+
Write-Host "Updating nanoFramework.Tools.MetadataProcessor.Core package in VS2019 solution..."
5660

57-
nuget update -Id nanoFramework.Tools.MetadataProcessor.Core Tools.BuildTasks-2019\Tools.BuildTasks.csproj -ConfigFile NuGet.Config
58-
nuget update -Id nanoFramework.Tools.MetadataProcessor.Core VisualStudio.Extension-2019\VisualStudio.Extension.csproj -ConfigFile NuGet.Config
61+
nuget update -Id nanoFramework.Tools.MetadataProcessor.Core Tools.BuildTasks-2019\Tools.BuildTasks.csproj -ConfigFile NuGet.Config -PreRelease
62+
nuget update -Id nanoFramework.Tools.MetadataProcessor.Core VisualStudio.Extension-2019\VisualStudio.Extension.csproj -ConfigFile NuGet.Config -PreRelease
5963

6064
#####################
6165

0 commit comments

Comments
 (0)