Skip to content

Commit

Permalink
Enable private feeds for release branch (#10355)
Browse files Browse the repository at this point in the history
This PR enables MSBuild to take security fixes from MSBuild dependencies.
  • Loading branch information
AR-May authored Sep 11, 2024
1 parent 7d15f33 commit 33027ff
Show file tree
Hide file tree
Showing 4 changed files with 67 additions and 2 deletions.
50 changes: 50 additions & 0 deletions .vsts-dotnet-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,16 @@ trigger:
- exp/*
- vs*

variables:
- ${{ if eq(variables['System.TeamProject'], 'DevDiv') }}:
- group: AzureDevOps-Artifact-Feeds-Pats
- name: cfsNugetWarnLevel
value: warn
- name: nugetMultiFeedWarnLevel
value: none
- name: NugetSecurityAnalysisWarningLevel
value: none

jobs:
- job: CheckVersionBumpOnReleaseBranches
displayName: "Check Version Bump On Release Branches"
Expand Down Expand Up @@ -66,6 +76,14 @@ jobs:
pool:
vmImage: 'windows-2022'
steps:
- ${{ if eq(variables['System.TeamProject'], 'DevDiv') }}:
- task: PowerShell@2
displayName: Setup Private Feeds Credentials
inputs:
filePath: $(Build.SourcesDirectory)/eng/common/SetupNugetSources.ps1
arguments: -ConfigFile $(Build.SourcesDirectory)/NuGet.config -Password $Env:Token
env:
Token: $(dn-bot-dnceng-artifact-feeds-rw)
- task: BatchScript@1
displayName: cibuild_bootstrapped_msbuild.cmd
inputs:
Expand Down Expand Up @@ -137,6 +155,14 @@ jobs:
pool:
vmImage: 'windows-2022'
steps:
- ${{ if eq(variables['System.TeamProject'], 'DevDiv') }}:
- task: PowerShell@2
displayName: Setup Private Feeds Credentials
inputs:
filePath: $(Build.SourcesDirectory)/eng/common/SetupNugetSources.ps1
arguments: -ConfigFile $(Build.SourcesDirectory)/NuGet.config -Password $Env:Token
env:
Token: $(dn-bot-dnceng-artifact-feeds-rw)
- task: BatchScript@1
displayName: cibuild_bootstrapped_msbuild.cmd
inputs:
Expand Down Expand Up @@ -192,6 +218,14 @@ jobs:
name: VSEngSS-MicroBuild2022-1ES
demands: agent.os -equals Windows_NT
steps:
- ${{ if eq(variables['System.TeamProject'], 'DevDiv') }}:
- task: PowerShell@2
displayName: Setup Private Feeds Credentials
inputs:
filePath: $(Build.SourcesDirectory)/eng/common/SetupNugetSources.ps1
arguments: -ConfigFile $(Build.SourcesDirectory)/NuGet.config -Password $Env:Token
env:
Token: $(dn-bot-dnceng-artifact-feeds-rw)
- task: BatchScript@1
displayName: cibuild.cmd
inputs:
Expand Down Expand Up @@ -266,6 +300,14 @@ jobs:
pool:
vmImage: 'ubuntu-latest'
steps:
- ${{ if eq(variables['System.TeamProject'], 'DevDiv') }}:
- task: Bash@3
displayName: Setup Private Feeds Credentials
inputs:
filePath: $(Build.SourcesDirectory)/eng/common/SetupNugetSources.sh
arguments: $(Build.SourcesDirectory)/NuGet.config $Token
env:
Token: $(dn-bot-dnceng-artifact-feeds-rw)
- bash: . 'eng/cibuild_bootstrapped_msbuild.sh' --onlyDocChanged $(onlyDocChanged)
displayName: CI Build
- task: PublishTestResults@2
Expand Down Expand Up @@ -323,6 +365,14 @@ jobs:
pool:
vmImage: 'macOS-latest'
steps:
- ${{ if eq(variables['System.TeamProject'], 'DevDiv') }}:
- task: Bash@3
displayName: Setup Private Feeds Credentials
inputs:
filePath: $(Build.SourcesDirectory)/eng/common/SetupNugetSources.sh
arguments: $(Build.SourcesDirectory)/NuGet.config $Token
env:
Token: $(dn-bot-dnceng-artifact-feeds-rw)
- bash: . 'eng/cibuild_bootstrapped_msbuild.sh' --onlyDocChanged $(onlyDocChanged)
displayName: CI Build
- task: PublishTestResults@2
Expand Down
15 changes: 15 additions & 0 deletions .vsts-dotnet.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,13 @@ variables:
- name: Codeql.Enabled
value: true
- group: DotNet-MSBuild-SDLValidation-Params
- group: AzureDevOps-Artifact-Feeds-Pats
- name: cfsNugetWarnLevel
value: warn
- name: nugetMultiFeedWarnLevel
value: none
- name: NugetSecurityAnalysisWarningLevel
value: none

resources:
repositories:
Expand Down Expand Up @@ -110,6 +117,14 @@ extends:
- task: NuGetToolInstaller@1
displayName: 'Install NuGet.exe'

- task: PowerShell@2
displayName: Setup Private Feeds Credentials
inputs:
filePath: $(Build.SourcesDirectory)/eng/common/SetupNugetSources.ps1
arguments: -ConfigFile $(Build.SourcesDirectory)/NuGet.config -Password $Env:Token
env:
Token: $(dn-bot-dnceng-artifact-feeds-rw)

- task: NuGetCommand@2
displayName: Restore internal tools
inputs:
Expand Down
2 changes: 1 addition & 1 deletion eng/Versions.props
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<!-- Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the MIT license. See License.txt in the project root for full license information. -->
<Project>
<PropertyGroup>
<VersionPrefix>17.10.7</VersionPrefix><DotNetFinalVersionKind>release</DotNetFinalVersionKind>
<VersionPrefix>17.10.8</VersionPrefix><DotNetFinalVersionKind>release</DotNetFinalVersionKind>
<PackageValidationBaselineVersion>17.8.3</PackageValidationBaselineVersion>
<AssemblyVersion>15.1.0.0</AssemblyVersion>
<PreReleaseVersionLabel>preview</PreReleaseVersionLabel>
Expand Down
2 changes: 1 addition & 1 deletion eng/build.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ function Set-OptProfVariables() {

function Check-EditedFiles() {
# Log VSTS errors for changed lines
git --no-pager diff HEAD --unified=0 --no-color --exit-code | ForEach-Object { "##vso[task.logissue type=error] $_" }
git --no-pager diff HEAD --unified=0 --no-color --exit-code -- src/ | ForEach-Object { "##vso[task.logissue type=error] $_" }
if ($LASTEXITCODE -ne 0) {
throw "##vso[task.logissue type=error] After building, there are changed files. Please build locally and include these changes in your pull request."
}
Expand Down

0 comments on commit 33027ff

Please sign in to comment.