Skip to content

Commit

Permalink
Use a variable to control the restore via the GitHub package feed or not
Browse files Browse the repository at this point in the history
  • Loading branch information
marcovisserFurore committed Sep 25, 2023
1 parent e661642 commit 01f6b3f
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 5 deletions.
12 changes: 8 additions & 4 deletions build/azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,10 +54,14 @@ stages:
inputs:
versionSpec: '6.4.0'

- template: restore.yml@templates
parameters:
nuGetServiceConnections: GitHubPackageGetFeed
nuGetSources: --source https://nuget.pkg.github.com/FirelyTeam/index.json
- ${{ if eq(variables['USE_GITHUB_PACKAGEFEED'], 'true') }}:
- template: restore.yml@templates
parameters:
nuGetServiceConnections: GitHubPackageGetFeed
nuGetSources: --source https://nuget.pkg.github.com/FirelyTeam/index.json

- ${{ if eq(variables['USE_GITHUB_PACKAGEFEED'], 'false') }}:
- script: dotnet restore --source https://api.nuget.org/v3/index.json

- task: DotNetCoreCLI@2
displayName: Build
Expand Down
3 changes: 2 additions & 1 deletion build/pipeline-variables.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,5 @@
variables:
isTagBranch: $[startswith(variables['Build.SourceBranch'], 'refs/tags/v')]
GITHUB_PACKAGES_APIKEY: $(GitHubPushPackagesAPIKey) # key is set in variable group APIKeys
NUGET_APIKEY: $(NuGetSDKAPIKey) # key is set in variable group APIKeys
NUGET_APIKEY: $(NuGetSDKAPIKey) # key is set in variable group APIKeys
USE_GITHUB_PACKAGEFEED: $(UseGitHubPackageFeed) # key is set in the pipeline UI

0 comments on commit 01f6b3f

Please sign in to comment.