Fix .NET SDK install for NuGet job.

pull/153/head
Laurents Meyer 2 years ago
parent b4c07a382c
commit 7f397d8e63

@ -128,12 +128,23 @@ jobs:
pool: pool:
vmImage: 'windows-latest' # must be Windows for PublishSymbols task vmImage: 'windows-latest' # must be Windows for PublishSymbols task
steps: steps:
- task: UseDotNet@2 - pwsh: |
displayName: 'Use .NET Core SDK' $dotnetInstallDirectory = Join-Path $env:ProgramFiles 'dotnet'
inputs: echo "##vso[task.setvariable variable=dotnetInstallDirectory]$dotnetInstallDirectory"
useGlobalJson: true
- pwsh: dotnet --info $dotnetPath = Join-Path $dotnetInstallDirectory 'dotnet.exe'
displayName: .NET Information echo "##vso[task.setvariable variable=dotnetPath]$dotnetPath"
displayName: Set additional variables
- pwsh: |
try { & '$(dotnetPath)' --info } catch { echo 'No .NET SDK installed' }
displayName: .NET Information Before SDK Install
- pwsh: |
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12;
&([scriptblock]::Create((Invoke-WebRequest -UseBasicParsing 'https://dot.net/v1/dotnet-install.ps1'))) -JSonFile global.json -InstallDir '$(dotnetInstallDirectory)' -Verbose
displayName: Install .NET SDK
- pwsh: |
try { & '$(dotnetPath)' --info } catch { echo 'No .NET SDK installed' }
displayName: .NET Information After SDK Install
- pwsh: | - pwsh: |
$officialBuild = '$(Build.SourceBranch)' -match '(?<=^refs/tags/v)\d+\.\d+\.\d+.*$' $officialBuild = '$(Build.SourceBranch)' -match '(?<=^refs/tags/v)\d+\.\d+\.\d+.*$'
$officialVersion = $Matches.0 $officialVersion = $Matches.0
@ -172,8 +183,8 @@ jobs:
{ {
try try
{ {
echo "Pack command: dotnet " + (($arguments + $projectFile) -join ' ') echo "Pack command: & '$(dotnetPath)' $(($arguments + $projectFile) -join ' ')"
& dotnet ($arguments + $projectFile) & '$(dotnetPath)' ($arguments + $projectFile)
} }
catch catch
{ {
@ -201,14 +212,14 @@ jobs:
command: push command: push
publishVstsFeed: 'EntityFrameworkCore.Jet/public' publishVstsFeed: 'EntityFrameworkCore.Jet/public'
packagesToPush: '$(Build.ArtifactStagingDirectory)/**/*.nupkg;!$(Build.ArtifactStagingDirectory)/**/*.symbols.nupkg' packagesToPush: '$(Build.ArtifactStagingDirectory)/**/*.nupkg;!$(Build.ArtifactStagingDirectory)/**/*.symbols.nupkg'
condition: eq(variables['Pack.PushToAzureArtifacts'],'true') condition: and(succeeded(), eq(variables['Pack.PushToAzureArtifacts'],'true'))
- task: PublishSymbols@2 # AZDO still has no snupkg support, so we need to publish the PDB files to a symbol server - task: PublishSymbols@2 # AZDO still has no snupkg support, so we need to publish the PDB files to a symbol server
displayName: "Publish Symbols to Azure Artifacts symbol server" displayName: "Publish Symbols to Azure Artifacts symbol server"
inputs: inputs:
symbolServerType: 'TeamServices' symbolServerType: 'TeamServices'
treatNotIndexedAsWarning: false treatNotIndexedAsWarning: false
indexSources: false indexSources: false
condition: eq(variables['Pack.PublishSymbolsForAzureArtifacts'],'true') condition: and(succeeded(), eq(variables['Pack.PublishSymbolsForAzureArtifacts'],'true'))
- task: NuGetCommand@2 - task: NuGetCommand@2
displayName: "NuGet Push - nuget.org" displayName: "NuGet Push - nuget.org"
inputs: inputs:
@ -216,4 +227,4 @@ jobs:
nuGetFeedType: external nuGetFeedType: external
publishFeedCredentials: LauXjpn-NugetOrg-EFCoreJet-AllPackages-PushNew publishFeedCredentials: LauXjpn-NugetOrg-EFCoreJet-AllPackages-PushNew
packagesToPush: '$(Build.ArtifactStagingDirectory)/**/*.nupkg;!$(Build.ArtifactStagingDirectory)/**/*.symbols.nupkg' packagesToPush: '$(Build.ArtifactStagingDirectory)/**/*.nupkg;!$(Build.ArtifactStagingDirectory)/**/*.symbols.nupkg'
condition: eq(variables['Pack.PushToNugetOrg'],'true') condition: and(succeeded(), eq(variables['Pack.PushToNugetOrg'],'true'))

Loading…
Cancel
Save