Skip to content

Commit 7ca48b5

Browse files
Fix caching of NuGet packages caching (use explicit path, add restore keys and remove restore condition)
1 parent 8786c90 commit 7ca48b5

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

azure-pipelines.yml

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
variables:
22
solution: Umbraco.StorageProviders.sln
33
buildConfiguration: Release
4-
NUGET_PACKAGES: ''
4+
NUGET_PACKAGES: $(Pipeline.Workspace)/.nuget/packages
55
DOTNET_NOLOGO: true
66
DOTNET_GENERATE_ASPNET_CERTIFICATE: false
77
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: true
@@ -14,15 +14,16 @@ stages:
1414
vmImage: windows-latest
1515
steps:
1616
- task: Cache@2
17-
displayName: Cache NuGet packages
1817
inputs:
1918
key: 'nuget | "$(Agent.OS)" | **/packages.lock.json'
20-
path: '$(NUGET_PACKAGES)'
21-
cacheHitVar: 'CACHE_RESTORED'
19+
restoreKeys: |
20+
nuget | "$(Agent.OS)"
21+
nuget
22+
path: $(NUGET_PACKAGES)
23+
displayName: Cache NuGet packages
2224

2325
- script: dotnet restore $(solution) --locked-mode
2426
displayName: Restore NuGet packages
25-
condition: ne(variables.CACHE_RESTORED, true)
2627

2728
- script: dotnet build $(solution) -c $(buildConfiguration) -p:ContinuousIntegrationBuild=true --no-restore
2829
displayName: Build
@@ -31,6 +32,6 @@ stages:
3132
displayName: Pack
3233

3334
- task: PublishBuildArtifacts@1
34-
displayName: Publish NuGet packages
3535
inputs:
3636
ArtifactName: nupkg
37+
displayName: Publish NuGet packages

0 commit comments

Comments
 (0)