|
| 1 | +--- |
| 2 | +name: prepare-release |
| 3 | +description: Prepares the repository for an internal release branch. Use this when asked to "prepare for a release", "prepare internal release branch", or similar release preparation tasks. |
| 4 | +--- |
| 5 | + |
| 6 | +# Prepare Internal Release Branch |
| 7 | + |
| 8 | +When preparing a public branch for internal release, apply the following changes: |
| 9 | + |
| 10 | +## 1. Directory.Build.props |
| 11 | + |
| 12 | +Add NU1507 warning suppression after the `TestNetCoreTargetFrameworks` PropertyGroup. Internal branches don't use package source mapping due to internal feeds: |
| 13 | + |
| 14 | +```xml |
| 15 | +<!-- Internal branches don't use package source mapping feature due to internal feeds, so disable NU1507 warning saying it should be used. --> |
| 16 | +<PropertyGroup> |
| 17 | + <NoWarn>$(NoWarn);NU1507</NoWarn> |
| 18 | +</PropertyGroup> |
| 19 | +``` |
| 20 | + |
| 21 | +Insert this new PropertyGroup right after the closing `</PropertyGroup>` that contains `TestNetCoreTargetFrameworks`. |
| 22 | + |
| 23 | +## 2. NuGet.config |
| 24 | + |
| 25 | +Remove the entire `<packageSourceMapping>` section. This section looks like: |
| 26 | + |
| 27 | +```xml |
| 28 | +<!-- Define mappings by adding package patterns beneath the target source. |
| 29 | + https://aka.ms/nuget-package-source-mapping --> |
| 30 | +<packageSourceMapping> |
| 31 | + <packageSource key="dotnet-public"> |
| 32 | + <package pattern="*" /> |
| 33 | + </packageSource> |
| 34 | + <packageSource key="dotnet-eng"> |
| 35 | + <package pattern="*" /> |
| 36 | + </packageSource> |
| 37 | + <!-- ... more packageSource entries ... --> |
| 38 | +</packageSourceMapping> |
| 39 | +``` |
| 40 | + |
| 41 | +**Important**: Do NOT add new internal feed sources to NuGet.config - those are managed by Dependency Flow automation and will be added automatically. |
| 42 | + |
| 43 | +## 3. eng/Versions.props |
| 44 | + |
| 45 | +Update these two properties (do NOT change any version numbers): |
| 46 | + |
| 47 | +Change `StabilizePackageVersion` from `false` to `true`: |
| 48 | +```xml |
| 49 | +<StabilizePackageVersion Condition="'$(StabilizePackageVersion)' == ''">true</StabilizePackageVersion> |
| 50 | +``` |
| 51 | + |
| 52 | +Change `DotNetFinalVersionKind` from empty to `release`: |
| 53 | +```xml |
| 54 | +<DotNetFinalVersionKind>release</DotNetFinalVersionKind> |
| 55 | +``` |
| 56 | + |
| 57 | +## 4. eng/pipelines/templates/BuildAndTest.yml |
| 58 | + |
| 59 | +### Add Private Feeds Credentials Setup |
| 60 | + |
| 61 | +After the Node.js setup task (the `NodeTool@0` task), add these two tasks to authenticate with private Azure DevOps feeds: |
| 62 | + |
| 63 | +```yaml |
| 64 | + - task: PowerShell@2 |
| 65 | + displayName: Setup Private Feeds Credentials |
| 66 | + condition: eq(variables['Agent.OS'], 'Windows_NT') |
| 67 | + inputs: |
| 68 | + filePath: $(Build.SourcesDirectory)/eng/common/SetupNugetSources.ps1 |
| 69 | + arguments: -ConfigFile $(Build.SourcesDirectory)/NuGet.config -Password $Env:Token |
| 70 | + env: |
| 71 | + Token: $(dn-bot-dnceng-artifact-feeds-rw) |
| 72 | + |
| 73 | + - task: Bash@3 |
| 74 | + displayName: Setup Private Feeds Credentials |
| 75 | + condition: ne(variables['Agent.OS'], 'Windows_NT') |
| 76 | + inputs: |
| 77 | + filePath: $(Build.SourcesDirectory)/eng/common/SetupNugetSources.sh |
| 78 | + arguments: $(Build.SourcesDirectory)/NuGet.config $Token |
| 79 | + env: |
| 80 | + Token: $(dn-bot-dnceng-artifact-feeds-rw) |
| 81 | +``` |
| 82 | +
|
| 83 | +### Comment Out Integration Tests |
| 84 | +
|
| 85 | +Comment out the integration tests step as they require authentication to private feeds that isn't available during internal release builds: |
| 86 | +
|
| 87 | +```yaml |
| 88 | + - ${{ if ne(parameters.skipTests, 'true') }}: |
| 89 | + # Skipping integration tests for now as they require authentication to the private feeds |
| 90 | + # - script: ${{ parameters.buildScript }} |
| 91 | + # -integrationTest |
| 92 | + # -configuration ${{ parameters.buildConfig }} |
| 93 | + # -warnAsError 1 |
| 94 | + # /bl:${{ parameters.repoLogPath }}/integration_tests.binlog |
| 95 | + # $(_OfficialBuildIdArgs) |
| 96 | + # displayName: Run integration tests |
| 97 | +``` |
| 98 | + |
| 99 | +## 5. azure-pipelines.yml |
| 100 | + |
| 101 | +Remove the `codecoverage` stage entirely. This is the stage that: |
| 102 | +- Has `displayName: CodeCoverage` |
| 103 | +- Downloads code coverage reports from build jobs |
| 104 | +- Merges and validates combined test coverage |
| 105 | +- Contains a `CodeCoverageReport` job |
| 106 | + |
| 107 | +Also remove the `codecoverage` dependency from the post-build validation's `validateDependsOn` list: |
| 108 | + |
| 109 | +```yaml |
| 110 | +# Remove this conditional dependency block: |
| 111 | +- ${{ if eq(parameters.runTests, true) }}: |
| 112 | + - codecoverage |
| 113 | +``` |
| 114 | +
|
| 115 | +## Files NOT to modify |
| 116 | +
|
| 117 | +- **eng/Version.Details.xml**: Version updates are managed by Dependency Flow automation |
| 118 | +- **eng/Versions.props version numbers**: Package versions are managed by Dependency Flow automation |
| 119 | +- **NuGet.config feed sources**: Internal darc feeds are added automatically by Dependency Flow |
| 120 | +
|
| 121 | +## Summary |
| 122 | +
|
| 123 | +| File | Action | |
| 124 | +|------|--------| |
| 125 | +| Directory.Build.props | Add `NU1507` to `NoWarn` in new PropertyGroup | |
| 126 | +| NuGet.config | Remove entire `<packageSourceMapping>` section | |
| 127 | +| eng/Versions.props | Set `StabilizePackageVersion=true`, `DotNetFinalVersionKind=release` | |
| 128 | +| eng/pipelines/templates/BuildAndTest.yml | Add private feeds credentials setup tasks, comment out integration tests | |
| 129 | +| azure-pipelines.yml | Remove `codecoverage` stage and its post-build dependency | |
0 commit comments