From 94eba4a33a15fd28a0693bba3e3e5086d0df8d24 Mon Sep 17 00:00:00 2001 From: Andrew Arnott Date: Mon, 23 Dec 2024 09:48:35 -0700 Subject: [PATCH 01/11] Build servicing branches --- .github/workflows/build.yml | 1 + azure-pipelines.yml | 1 + 2 files changed, 2 insertions(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 474d90c..fbd7115 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -4,6 +4,7 @@ on: push: branches: - main + - 'v*.*' - validate/* pull_request: workflow_dispatch: diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 9867b3d..4d372fe 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -3,6 +3,7 @@ trigger: branches: include: - main + - 'v*.*' - 'validate/*' paths: exclude: From 275a44b6c5cb089a21ac2b2456c55d66ec172236 Mon Sep 17 00:00:00 2001 From: Andrew Arnott Date: Mon, 23 Dec 2024 11:39:09 -0700 Subject: [PATCH 02/11] Do not publish artifacts on cancelled GitHub workflows --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index fbd7115..58e56cc 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -62,7 +62,7 @@ jobs: shell: pwsh - name: ๐Ÿ“ข Publish artifacts uses: ./.github/actions/publish-artifacts - if: always() + if: cancelled() == false - name: ๐Ÿ“ข Publish code coverage results to codecov.io run: ./azure-pipelines/publish-CodeCov.ps1 -CodeCovToken "${{ env.codecov_token }}" -PathToCodeCoverage "${{ runner.temp }}/_artifacts/coverageResults" -Name "${{ runner.os }} Coverage Results" -Flags "${{ runner.os }}" shell: pwsh From 8870497c3473ebc75324c5356b36b4361f2a9065 Mon Sep 17 00:00:00 2001 From: Andrew Arnott Date: Tue, 24 Dec 2024 09:12:10 -0700 Subject: [PATCH 03/11] Move scripts that apply to github workflows from azp to tools --- .github/workflows/build.yml | 4 ++-- .github/workflows/libtemplate-update.yml | 2 +- azure-pipelines/artifacts/_stage_all.ps1 | 2 +- azure-pipelines/artifacts/build_logs.ps1 | 2 +- azure-pipelines/dotnet.yml | 6 +++--- azure-pipelines/libtemplate-update.yml | 2 +- init.ps1 | 2 +- .../Get-ArtifactsStagingDirectory.ps1 | 0 {azure-pipelines => tools}/Get-CodeCovTool.ps1 | 0 {azure-pipelines => tools}/Get-LibTemplateBasis.ps1 | 0 {azure-pipelines => tools}/Get-NuGetTool.ps1 | 0 {azure-pipelines => tools}/Get-ProcDump.ps1 | 0 {azure-pipelines => tools}/Get-TempToolsPath.ps1 | 0 tools/Install-NuGetCredProvider.ps1 | 2 +- tools/MergeFrom-Template.ps1 | 2 +- {azure-pipelines => tools}/dotnet-test-cloud.ps1 | 0 {azure-pipelines => tools}/publish-CodeCov.ps1 | 0 {azure-pipelines => tools}/test.runsettings | 0 18 files changed, 12 insertions(+), 12 deletions(-) rename {azure-pipelines => tools}/Get-ArtifactsStagingDirectory.ps1 (100%) rename {azure-pipelines => tools}/Get-CodeCovTool.ps1 (100%) rename {azure-pipelines => tools}/Get-LibTemplateBasis.ps1 (100%) rename {azure-pipelines => tools}/Get-NuGetTool.ps1 (100%) rename {azure-pipelines => tools}/Get-ProcDump.ps1 (100%) rename {azure-pipelines => tools}/Get-TempToolsPath.ps1 (100%) rename {azure-pipelines => tools}/dotnet-test-cloud.ps1 (100%) mode change 100755 => 100644 rename {azure-pipelines => tools}/publish-CodeCov.ps1 (100%) rename {azure-pipelines => tools}/test.runsettings (100%) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 58e56cc..5e338ff 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -48,7 +48,7 @@ jobs: - name: ๐Ÿ›  build run: dotnet build -t:build,pack --no-restore -c ${{ env.BUILDCONFIGURATION }} -warnAsError -warnNotAsError:NU1901,NU1902,NU1903,NU1904 /bl:"${{ runner.temp }}/_artifacts/build_logs/build.binlog" - name: ๐Ÿงช test - run: azure-pipelines/dotnet-test-cloud.ps1 -Configuration ${{ env.BUILDCONFIGURATION }} -Agent ${{ runner.os }} + run: tools/dotnet-test-cloud.ps1 -Configuration ${{ env.BUILDCONFIGURATION }} -Agent ${{ runner.os }} shell: pwsh - name: ๐Ÿ’…๐Ÿป Verify formatted code run: dotnet format --verify-no-changes --no-restore @@ -64,7 +64,7 @@ jobs: uses: ./.github/actions/publish-artifacts if: cancelled() == false - name: ๐Ÿ“ข Publish code coverage results to codecov.io - run: ./azure-pipelines/publish-CodeCov.ps1 -CodeCovToken "${{ env.codecov_token }}" -PathToCodeCoverage "${{ runner.temp }}/_artifacts/coverageResults" -Name "${{ runner.os }} Coverage Results" -Flags "${{ runner.os }}" + run: ./tools/publish-CodeCov.ps1 -CodeCovToken "${{ env.codecov_token }}" -PathToCodeCoverage "${{ runner.temp }}/_artifacts/coverageResults" -Name "${{ runner.os }} Coverage Results" -Flags "${{ runner.os }}" shell: pwsh timeout-minutes: 3 continue-on-error: true diff --git a/.github/workflows/libtemplate-update.yml b/.github/workflows/libtemplate-update.yml index f78c7e0..c6b8fb4 100644 --- a/.github/workflows/libtemplate-update.yml +++ b/.github/workflows/libtemplate-update.yml @@ -25,7 +25,7 @@ jobs: id: merge shell: pwsh run: | - $LibTemplateBranch = & ./azure-pipelines/Get-LibTemplateBasis.ps1 -ErrorIfNotRelated + $LibTemplateBranch = & ./tools/Get-LibTemplateBasis.ps1 -ErrorIfNotRelated if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE } diff --git a/azure-pipelines/artifacts/_stage_all.ps1 b/azure-pipelines/artifacts/_stage_all.ps1 index bf961ce..08e9844 100644 --- a/azure-pipelines/artifacts/_stage_all.ps1 +++ b/azure-pipelines/artifacts/_stage_all.ps1 @@ -11,7 +11,7 @@ param ( [switch]$AvoidSymbolicLinks ) -$ArtifactStagingFolder = & "$PSScriptRoot/../Get-ArtifactsStagingDirectory.ps1" -CleanIfLocal +$ArtifactStagingFolder = & "$PSScriptRoot/../../tools/Get-ArtifactsStagingDirectory.ps1" -CleanIfLocal function Create-SymbolicLink { param ( diff --git a/azure-pipelines/artifacts/build_logs.ps1 b/azure-pipelines/artifacts/build_logs.ps1 index f05358e..10c5478 100644 --- a/azure-pipelines/artifacts/build_logs.ps1 +++ b/azure-pipelines/artifacts/build_logs.ps1 @@ -1,4 +1,4 @@ -$ArtifactStagingFolder = & "$PSScriptRoot/../Get-ArtifactsStagingDirectory.ps1" +$ArtifactStagingFolder = & "$PSScriptRoot/../../tools/Get-ArtifactsStagingDirectory.ps1" if (!(Test-Path $ArtifactStagingFolder/build_logs)) { return } diff --git a/azure-pipelines/dotnet.yml b/azure-pipelines/dotnet.yml index 2444928..2ce80af 100644 --- a/azure-pipelines/dotnet.yml +++ b/azure-pipelines/dotnet.yml @@ -6,7 +6,7 @@ steps: - script: dotnet build -t:build,pack --no-restore -c $(BuildConfiguration) -warnAsError -warnNotAsError:NU1901,NU1902,NU1903,NU1904 /bl:"$(Build.ArtifactStagingDirectory)/build_logs/build.binlog" displayName: ๐Ÿ›  dotnet build -- powershell: azure-pipelines/dotnet-test-cloud.ps1 -Configuration $(BuildConfiguration) -Agent $(Agent.JobName) -PublishResults +- powershell: tools/dotnet-test-cloud.ps1 -Configuration $(BuildConfiguration) -Agent $(Agent.JobName) -PublishResults displayName: ๐Ÿงช dotnet test condition: and(succeeded(), ${{ parameters.RunTests }}) @@ -22,9 +22,9 @@ steps: - ${{ if and(ne(variables['codecov_token'], ''), parameters.RunTests) }}: - powershell: | - $ArtifactStagingFolder = & "azure-pipelines/Get-ArtifactsStagingDirectory.ps1" + $ArtifactStagingFolder = & "tools/Get-ArtifactsStagingDirectory.ps1" $CoverageResultsFolder = Join-Path $ArtifactStagingFolder "coverageResults-$(Agent.JobName)" - azure-pipelines/publish-CodeCov.ps1 -CodeCovToken "$(codecov_token)" -PathToCodeCoverage "$CoverageResultsFolder" -Name "$(Agent.JobName) Coverage Results" -Flags "$(Agent.JobName)" + tools/publish-CodeCov.ps1 -CodeCovToken "$(codecov_token)" -PathToCodeCoverage "$CoverageResultsFolder" -Name "$(Agent.JobName) Coverage Results" -Flags "$(Agent.JobName)" displayName: ๐Ÿ“ข Publish code coverage results to codecov.io timeoutInMinutes: 3 continueOnError: true diff --git a/azure-pipelines/libtemplate-update.yml b/azure-pipelines/libtemplate-update.yml index 87302b0..fdfa1df 100644 --- a/azure-pipelines/libtemplate-update.yml +++ b/azure-pipelines/libtemplate-update.yml @@ -28,7 +28,7 @@ stages: fetchDepth: 0 clean: true - pwsh: | - $LibTemplateBranch = & ./azure-pipelines/Get-LibTemplateBasis.ps1 -ErrorIfNotRelated + $LibTemplateBranch = & ./tools/Get-LibTemplateBasis.ps1 -ErrorIfNotRelated if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE } diff --git a/init.ps1 b/init.ps1 index e284985..b4004e7 100755 --- a/init.ps1 +++ b/init.ps1 @@ -71,7 +71,7 @@ if (!$NoPrerequisites) { # The procdump tool and env var is required for dotnet test to collect hang/crash dumps of tests. # But it only works on Windows. if ($env:OS -eq 'Windows_NT') { - $EnvVars['PROCDUMP_PATH'] = & "$PSScriptRoot\azure-pipelines\Get-ProcDump.ps1" + $EnvVars['PROCDUMP_PATH'] = & "$PSScriptRoot\tools\Get-ProcDump.ps1" } } diff --git a/azure-pipelines/Get-ArtifactsStagingDirectory.ps1 b/tools/Get-ArtifactsStagingDirectory.ps1 similarity index 100% rename from azure-pipelines/Get-ArtifactsStagingDirectory.ps1 rename to tools/Get-ArtifactsStagingDirectory.ps1 diff --git a/azure-pipelines/Get-CodeCovTool.ps1 b/tools/Get-CodeCovTool.ps1 similarity index 100% rename from azure-pipelines/Get-CodeCovTool.ps1 rename to tools/Get-CodeCovTool.ps1 diff --git a/azure-pipelines/Get-LibTemplateBasis.ps1 b/tools/Get-LibTemplateBasis.ps1 similarity index 100% rename from azure-pipelines/Get-LibTemplateBasis.ps1 rename to tools/Get-LibTemplateBasis.ps1 diff --git a/azure-pipelines/Get-NuGetTool.ps1 b/tools/Get-NuGetTool.ps1 similarity index 100% rename from azure-pipelines/Get-NuGetTool.ps1 rename to tools/Get-NuGetTool.ps1 diff --git a/azure-pipelines/Get-ProcDump.ps1 b/tools/Get-ProcDump.ps1 similarity index 100% rename from azure-pipelines/Get-ProcDump.ps1 rename to tools/Get-ProcDump.ps1 diff --git a/azure-pipelines/Get-TempToolsPath.ps1 b/tools/Get-TempToolsPath.ps1 similarity index 100% rename from azure-pipelines/Get-TempToolsPath.ps1 rename to tools/Get-TempToolsPath.ps1 diff --git a/tools/Install-NuGetCredProvider.ps1 b/tools/Install-NuGetCredProvider.ps1 index 2b904e3..b776f56 100755 --- a/tools/Install-NuGetCredProvider.ps1 +++ b/tools/Install-NuGetCredProvider.ps1 @@ -21,7 +21,7 @@ Param ( $envVars = @{} -$toolsPath = & "$PSScriptRoot\..\azure-pipelines\Get-TempToolsPath.ps1" +$toolsPath = & "$PSScriptRoot\Get-TempToolsPath.ps1" if ($IsMacOS -or $IsLinux) { $installerScript = "installcredprovider.sh" diff --git a/tools/MergeFrom-Template.ps1 b/tools/MergeFrom-Template.ps1 index 3f721c6..240a570 100644 --- a/tools/MergeFrom-Template.ps1 +++ b/tools/MergeFrom-Template.ps1 @@ -36,7 +36,7 @@ Function Spawn-Tool($command, $commandArgs, $workingDirectory, $allowFailures) { } } -$remoteBranch = & $PSScriptRoot\..\azure-pipelines\Get-LibTemplateBasis.ps1 -ErrorIfNotRelated +$remoteBranch = & $PSScriptRoot\Get-LibTemplateBasis.ps1 -ErrorIfNotRelated if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE } diff --git a/azure-pipelines/dotnet-test-cloud.ps1 b/tools/dotnet-test-cloud.ps1 old mode 100755 new mode 100644 similarity index 100% rename from azure-pipelines/dotnet-test-cloud.ps1 rename to tools/dotnet-test-cloud.ps1 diff --git a/azure-pipelines/publish-CodeCov.ps1 b/tools/publish-CodeCov.ps1 similarity index 100% rename from azure-pipelines/publish-CodeCov.ps1 rename to tools/publish-CodeCov.ps1 diff --git a/azure-pipelines/test.runsettings b/tools/test.runsettings similarity index 100% rename from azure-pipelines/test.runsettings rename to tools/test.runsettings From bb60632aa68a206d37505999b65228f2de86b032 Mon Sep 17 00:00:00 2001 From: Andrew Arnott Date: Tue, 24 Dec 2024 09:25:56 -0700 Subject: [PATCH 04/11] Remove unused nuget.config file --- azure-pipelines/justnugetorg.nuget.config | 7 ------- 1 file changed, 7 deletions(-) delete mode 100644 azure-pipelines/justnugetorg.nuget.config diff --git a/azure-pipelines/justnugetorg.nuget.config b/azure-pipelines/justnugetorg.nuget.config deleted file mode 100644 index 765346e..0000000 --- a/azure-pipelines/justnugetorg.nuget.config +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - - From abbd6b001e55897f9922dd90ddce51b8ad6bb818 Mon Sep 17 00:00:00 2001 From: Andrew Arnott Date: Tue, 24 Dec 2024 09:33:58 -0700 Subject: [PATCH 05/11] Move artifacts and variables scripts to `tools` --- .github/actions/publish-artifacts/action.yaml | 2 +- .github/workflows/build.yml | 4 ++-- .../{variables/_pipelines.ps1 => define_variables.ps1} | 2 +- azure-pipelines/dotnet.yml | 4 ++-- azure-pipelines/install-dependencies.yml | 2 +- .../{artifacts/_pipelines.ps1 => publish_artifacts.ps1} | 2 +- {azure-pipelines => tools}/Get-SymbolFiles.ps1 | 0 tools/Install-DotNetSdk.ps1 | 2 +- {azure-pipelines => tools}/artifacts/Variables.ps1 | 0 {azure-pipelines => tools}/artifacts/_all.ps1 | 0 {azure-pipelines => tools}/artifacts/_stage_all.ps1 | 0 {azure-pipelines => tools}/artifacts/build_logs.ps1 | 0 {azure-pipelines => tools}/artifacts/coverageResults.ps1 | 0 {azure-pipelines => tools}/artifacts/deployables.ps1 | 0 {azure-pipelines => tools}/artifacts/projectAssetsJson.ps1 | 0 {azure-pipelines => tools}/artifacts/symbols.ps1 | 0 {azure-pipelines => tools}/artifacts/testResults.ps1 | 0 {azure-pipelines => tools}/artifacts/test_symbols.ps1 | 0 {azure-pipelines => tools}/variables/DotNetSdkVersion.ps1 | 0 {azure-pipelines => tools}/variables/_all.ps1 | 0 20 files changed, 9 insertions(+), 9 deletions(-) rename azure-pipelines/{variables/_pipelines.ps1 => define_variables.ps1} (95%) rename azure-pipelines/{artifacts/_pipelines.ps1 => publish_artifacts.ps1} (92%) rename {azure-pipelines => tools}/Get-SymbolFiles.ps1 (100%) rename {azure-pipelines => tools}/artifacts/Variables.ps1 (100%) rename {azure-pipelines => tools}/artifacts/_all.ps1 (100%) mode change 100755 => 100644 rename {azure-pipelines => tools}/artifacts/_stage_all.ps1 (100%) rename {azure-pipelines => tools}/artifacts/build_logs.ps1 (100%) rename {azure-pipelines => tools}/artifacts/coverageResults.ps1 (100%) rename {azure-pipelines => tools}/artifacts/deployables.ps1 (100%) rename {azure-pipelines => tools}/artifacts/projectAssetsJson.ps1 (100%) rename {azure-pipelines => tools}/artifacts/symbols.ps1 (100%) rename {azure-pipelines => tools}/artifacts/testResults.ps1 (100%) rename {azure-pipelines => tools}/artifacts/test_symbols.ps1 (100%) rename {azure-pipelines => tools}/variables/DotNetSdkVersion.ps1 (100%) rename {azure-pipelines => tools}/variables/_all.ps1 (100%) mode change 100755 => 100644 diff --git a/.github/actions/publish-artifacts/action.yaml b/.github/actions/publish-artifacts/action.yaml index 94b7426..228b640 100644 --- a/.github/actions/publish-artifacts/action.yaml +++ b/.github/actions/publish-artifacts/action.yaml @@ -5,7 +5,7 @@ runs: using: composite steps: - name: ๐Ÿ“ฅ Collect artifacts - run: azure-pipelines/artifacts/_stage_all.ps1 + run: tools/artifacts/_stage_all.ps1 shell: pwsh if: always() diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 5e338ff..e6ffd30 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -43,7 +43,7 @@ jobs: } shell: pwsh - name: โš™๏ธ Set pipeline variables based on source - run: azure-pipelines/variables/_pipelines.ps1 + run: azure-pipelines/define_variables.ps1 shell: pwsh - name: ๐Ÿ›  build run: dotnet build -t:build,pack --no-restore -c ${{ env.BUILDCONFIGURATION }} -warnAsError -warnNotAsError:NU1901,NU1902,NU1903,NU1904 /bl:"${{ runner.temp }}/_artifacts/build_logs/build.binlog" @@ -58,7 +58,7 @@ jobs: run: dotnet docfx docfx/docfx.json --warningsAsErrors --disableGitFeatures if: runner.os == 'Linux' - name: โš™ Update pipeline variables based on build outputs - run: azure-pipelines/variables/_pipelines.ps1 + run: azure-pipelines/define_variables.ps1 shell: pwsh - name: ๐Ÿ“ข Publish artifacts uses: ./.github/actions/publish-artifacts diff --git a/azure-pipelines/variables/_pipelines.ps1 b/azure-pipelines/define_variables.ps1 similarity index 95% rename from azure-pipelines/variables/_pipelines.ps1 rename to azure-pipelines/define_variables.ps1 index d40e5cf..9cf3628 100644 --- a/azure-pipelines/variables/_pipelines.ps1 +++ b/azure-pipelines/define_variables.ps1 @@ -11,7 +11,7 @@ param ( ) -(& "$PSScriptRoot\_all.ps1").GetEnumerator() |% { +(& "$PSScriptRoot\..\tools\variables\_all.ps1").GetEnumerator() |% { # Always use ALL CAPS for env var names since Azure Pipelines converts variable names to all caps and on non-Windows OS, env vars are case sensitive. $keyCaps = $_.Key.ToUpper() if ((Test-Path "env:$keyCaps") -and (Get-Content "env:$keyCaps")) { diff --git a/azure-pipelines/dotnet.yml b/azure-pipelines/dotnet.yml index 2ce80af..f094223 100644 --- a/azure-pipelines/dotnet.yml +++ b/azure-pipelines/dotnet.yml @@ -10,12 +10,12 @@ steps: displayName: ๐Ÿงช dotnet test condition: and(succeeded(), ${{ parameters.RunTests }}) -- powershell: azure-pipelines/variables/_pipelines.ps1 +- powershell: azure-pipelines/define_variables.ps1 failOnStderr: true displayName: โš™ Update pipeline variables based on build outputs condition: succeededOrFailed() -- powershell: azure-pipelines/artifacts/_pipelines.ps1 -ArtifactNameSuffix "-$(Agent.JobName)" -Verbose +- powershell: azure-pipelines/publish_artifacts.ps1 -ArtifactNameSuffix "-$(Agent.JobName)" -Verbose failOnStderr: true displayName: ๐Ÿ“ข Publish artifacts condition: succeededOrFailed() diff --git a/azure-pipelines/install-dependencies.yml b/azure-pipelines/install-dependencies.yml index 8178266..ce88b25 100644 --- a/azure-pipelines/install-dependencies.yml +++ b/azure-pipelines/install-dependencies.yml @@ -19,7 +19,7 @@ steps: } displayName: โš™ Install prerequisites -- powershell: azure-pipelines/variables/_pipelines.ps1 +- powershell: azure-pipelines/define_variables.ps1 failOnStderr: true displayName: โš™ Set pipeline variables based on source name: SetPipelineVariables diff --git a/azure-pipelines/artifacts/_pipelines.ps1 b/azure-pipelines/publish_artifacts.ps1 similarity index 92% rename from azure-pipelines/artifacts/_pipelines.ps1 rename to azure-pipelines/publish_artifacts.ps1 index 5f259a5..3f35cc6 100644 --- a/azure-pipelines/artifacts/_pipelines.ps1 +++ b/azure-pipelines/publish_artifacts.ps1 @@ -25,7 +25,7 @@ Function Test-ArtifactUploaded($artifactName) { Test-Path "env:$varName" } -& "$PSScriptRoot/_stage_all.ps1" -ArtifactNameSuffix $ArtifactNameSuffix -AvoidSymbolicLinks:$AvoidSymbolicLinks |% { +& "$PSScriptRoot/../tools/artifacts/_stage_all.ps1" -ArtifactNameSuffix $ArtifactNameSuffix -AvoidSymbolicLinks:$AvoidSymbolicLinks |% { # Set a variable which will out-live this script so that a subsequent attempt to collect and upload artifacts # will skip this one from a check in the _all.ps1 script. Set-PipelineVariable "ARTIFACTSTAGED_$($_.Name.ToUpper())" 'true' diff --git a/azure-pipelines/Get-SymbolFiles.ps1 b/tools/Get-SymbolFiles.ps1 similarity index 100% rename from azure-pipelines/Get-SymbolFiles.ps1 rename to tools/Get-SymbolFiles.ps1 diff --git a/tools/Install-DotNetSdk.ps1 b/tools/Install-DotNetSdk.ps1 index ffb5220..e08571b 100644 --- a/tools/Install-DotNetSdk.ps1 +++ b/tools/Install-DotNetSdk.ps1 @@ -36,7 +36,7 @@ if (!(Test-Path $DotNetInstallScriptRoot)) { New-Item -ItemType Directory -Path $DotNetInstallScriptRoot = Resolve-Path $DotNetInstallScriptRoot # Look up actual required .NET SDK version from global.json -$sdkVersion = & "$PSScriptRoot/../azure-pipelines/variables/DotNetSdkVersion.ps1" +$sdkVersion = & "$PSScriptRoot/variables/DotNetSdkVersion.ps1" If ($IncludeX86 -and ($IsMacOS -or $IsLinux)) { Write-Verbose "Ignoring -IncludeX86 switch because 32-bit runtimes are only supported on Windows." diff --git a/azure-pipelines/artifacts/Variables.ps1 b/tools/artifacts/Variables.ps1 similarity index 100% rename from azure-pipelines/artifacts/Variables.ps1 rename to tools/artifacts/Variables.ps1 diff --git a/azure-pipelines/artifacts/_all.ps1 b/tools/artifacts/_all.ps1 old mode 100755 new mode 100644 similarity index 100% rename from azure-pipelines/artifacts/_all.ps1 rename to tools/artifacts/_all.ps1 diff --git a/azure-pipelines/artifacts/_stage_all.ps1 b/tools/artifacts/_stage_all.ps1 similarity index 100% rename from azure-pipelines/artifacts/_stage_all.ps1 rename to tools/artifacts/_stage_all.ps1 diff --git a/azure-pipelines/artifacts/build_logs.ps1 b/tools/artifacts/build_logs.ps1 similarity index 100% rename from azure-pipelines/artifacts/build_logs.ps1 rename to tools/artifacts/build_logs.ps1 diff --git a/azure-pipelines/artifacts/coverageResults.ps1 b/tools/artifacts/coverageResults.ps1 similarity index 100% rename from azure-pipelines/artifacts/coverageResults.ps1 rename to tools/artifacts/coverageResults.ps1 diff --git a/azure-pipelines/artifacts/deployables.ps1 b/tools/artifacts/deployables.ps1 similarity index 100% rename from azure-pipelines/artifacts/deployables.ps1 rename to tools/artifacts/deployables.ps1 diff --git a/azure-pipelines/artifacts/projectAssetsJson.ps1 b/tools/artifacts/projectAssetsJson.ps1 similarity index 100% rename from azure-pipelines/artifacts/projectAssetsJson.ps1 rename to tools/artifacts/projectAssetsJson.ps1 diff --git a/azure-pipelines/artifacts/symbols.ps1 b/tools/artifacts/symbols.ps1 similarity index 100% rename from azure-pipelines/artifacts/symbols.ps1 rename to tools/artifacts/symbols.ps1 diff --git a/azure-pipelines/artifacts/testResults.ps1 b/tools/artifacts/testResults.ps1 similarity index 100% rename from azure-pipelines/artifacts/testResults.ps1 rename to tools/artifacts/testResults.ps1 diff --git a/azure-pipelines/artifacts/test_symbols.ps1 b/tools/artifacts/test_symbols.ps1 similarity index 100% rename from azure-pipelines/artifacts/test_symbols.ps1 rename to tools/artifacts/test_symbols.ps1 diff --git a/azure-pipelines/variables/DotNetSdkVersion.ps1 b/tools/variables/DotNetSdkVersion.ps1 similarity index 100% rename from azure-pipelines/variables/DotNetSdkVersion.ps1 rename to tools/variables/DotNetSdkVersion.ps1 diff --git a/azure-pipelines/variables/_all.ps1 b/tools/variables/_all.ps1 old mode 100755 new mode 100644 similarity index 100% rename from azure-pipelines/variables/_all.ps1 rename to tools/variables/_all.ps1 From fe7350fbebf12912487fa3397bd5c9bd95127859 Mon Sep 17 00:00:00 2001 From: Andrew Arnott Date: Tue, 24 Dec 2024 09:51:28 -0700 Subject: [PATCH 06/11] Move variable definition script --- .github/workflows/build.yml | 4 ++-- azure-pipelines/dotnet.yml | 2 +- azure-pipelines/install-dependencies.yml | 2 +- .../define_variables.ps1 => tools/variables/_define.ps1 | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) rename azure-pipelines/define_variables.ps1 => tools/variables/_define.ps1 (95%) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index e6ffd30..5b4fc7b 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -43,7 +43,7 @@ jobs: } shell: pwsh - name: โš™๏ธ Set pipeline variables based on source - run: azure-pipelines/define_variables.ps1 + run: tools/variables/_define.ps1 shell: pwsh - name: ๐Ÿ›  build run: dotnet build -t:build,pack --no-restore -c ${{ env.BUILDCONFIGURATION }} -warnAsError -warnNotAsError:NU1901,NU1902,NU1903,NU1904 /bl:"${{ runner.temp }}/_artifacts/build_logs/build.binlog" @@ -58,7 +58,7 @@ jobs: run: dotnet docfx docfx/docfx.json --warningsAsErrors --disableGitFeatures if: runner.os == 'Linux' - name: โš™ Update pipeline variables based on build outputs - run: azure-pipelines/define_variables.ps1 + run: tools/variables/_define.ps1 shell: pwsh - name: ๐Ÿ“ข Publish artifacts uses: ./.github/actions/publish-artifacts diff --git a/azure-pipelines/dotnet.yml b/azure-pipelines/dotnet.yml index f094223..30bb410 100644 --- a/azure-pipelines/dotnet.yml +++ b/azure-pipelines/dotnet.yml @@ -10,7 +10,7 @@ steps: displayName: ๐Ÿงช dotnet test condition: and(succeeded(), ${{ parameters.RunTests }}) -- powershell: azure-pipelines/define_variables.ps1 +- powershell: tools/variables/_define.ps1 failOnStderr: true displayName: โš™ Update pipeline variables based on build outputs condition: succeededOrFailed() diff --git a/azure-pipelines/install-dependencies.yml b/azure-pipelines/install-dependencies.yml index ce88b25..5944bc9 100644 --- a/azure-pipelines/install-dependencies.yml +++ b/azure-pipelines/install-dependencies.yml @@ -19,7 +19,7 @@ steps: } displayName: โš™ Install prerequisites -- powershell: azure-pipelines/define_variables.ps1 +- powershell: tools/variables/_define.ps1 failOnStderr: true displayName: โš™ Set pipeline variables based on source name: SetPipelineVariables diff --git a/azure-pipelines/define_variables.ps1 b/tools/variables/_define.ps1 similarity index 95% rename from azure-pipelines/define_variables.ps1 rename to tools/variables/_define.ps1 index 9cf3628..d40e5cf 100644 --- a/azure-pipelines/define_variables.ps1 +++ b/tools/variables/_define.ps1 @@ -11,7 +11,7 @@ param ( ) -(& "$PSScriptRoot\..\tools\variables\_all.ps1").GetEnumerator() |% { +(& "$PSScriptRoot\_all.ps1").GetEnumerator() |% { # Always use ALL CAPS for env var names since Azure Pipelines converts variable names to all caps and on non-Windows OS, env vars are case sensitive. $keyCaps = $_.Key.ToUpper() if ((Test-Path "env:$keyCaps") -and (Get-Content "env:$keyCaps")) { From bd10eaad9c1069e96c282383132765797b0344de Mon Sep 17 00:00:00 2001 From: Andrew Arnott Date: Thu, 26 Dec 2024 15:16:12 -0700 Subject: [PATCH 07/11] Group dependabot update PRs --- .github/dependabot.yml | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/.github/dependabot.yml b/.github/dependabot.yml index b168ac6..a7a1782 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -7,6 +7,14 @@ updates: directory: / schedule: interval: weekly + groups: + nerdbank-gitversioning: + patterns: + - nbgv + - nerdbank.gitversioning + xunit: + patterns: + - 'xunit*' - package-ecosystem: dotnet-sdk directory: / schedule: From 05072c1f50722d8eaa99e1a17299c57d5f1a5365 Mon Sep 17 00:00:00 2001 From: Andrew Arnott Date: Thu, 26 Dec 2024 16:06:41 -0700 Subject: [PATCH 08/11] Switch from Dependabot to Renovate --- .github/dependabot.yml | 21 --------------------- .github/renovate.json | 24 ++++++++++++++++++++++++ CONTRIBUTING.md | 10 ++++++++++ 3 files changed, 34 insertions(+), 21 deletions(-) delete mode 100644 .github/dependabot.yml create mode 100644 .github/renovate.json diff --git a/.github/dependabot.yml b/.github/dependabot.yml deleted file mode 100644 index a7a1782..0000000 --- a/.github/dependabot.yml +++ /dev/null @@ -1,21 +0,0 @@ -# Please see the documentation for all configuration options: -# https://docs.github.com/en/code-security/dependabot/dependabot-version-updates/configuration-options-for-the-dependabot.yml-file - -version: 2 -updates: -- package-ecosystem: nuget - directory: / - schedule: - interval: weekly - groups: - nerdbank-gitversioning: - patterns: - - nbgv - - nerdbank.gitversioning - xunit: - patterns: - - 'xunit*' -- package-ecosystem: dotnet-sdk - directory: / - schedule: - interval: monthly diff --git a/.github/renovate.json b/.github/renovate.json new file mode 100644 index 0000000..a9fbeb2 --- /dev/null +++ b/.github/renovate.json @@ -0,0 +1,24 @@ +{ + "$schema": "https://docs.renovatebot.com/renovate-schema.json", + "extends": [ + "config:recommended" + ], + "semanticCommits": "disabled", + "prHourlyLimit": 5, + "labels": ["dependencies"], + "packageRules": [ + { + "matchPackageNames": ["nbgv", "nerdbank.gitversioning"], + "groupName": "nbgv and nerdbank.gitversioning updates" + }, + { + "matchPackageNames": ["xunit*"], + "groupName": "xunit" + }, + { + "matchDatasources": ["dotnet-version", "docker"], + "matchDepNames": ["dotnet-sdk", "mcr.microsoft.com/dotnet/sdk"], + "groupName": "Dockerfile and global.json updates" + } + ] +} diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 52d83a8..77f5e0a 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -72,3 +72,13 @@ You can make changes and host the site locally to preview them by switching to t After making a change, you can rebuild the docs site while the localhost server is running by running `dotnet docfx` again from a separate terminal. The `.github/workflows/docs.yml` GitHub Actions workflow publishes the content of these docs to github.io if the workflow itself and [GitHub Pages is enabled for your repository](https://docs.github.com/en/pages/quickstart). + +## Updating dependencies + +This repo uses Renovate to keep dependencies current. +Configuration is in the `.github/renovate.json` file. +[Learn more about configuring Renovate](https://docs.renovatebot.com/configuration-options/). + +When changing the renovate.json file, follow [these validation steps](https://docs.renovatebot.com/config-validation/). + +If Renovate is not creating pull requests when you expect it to, check that the [Renovate GitHub App](https://github.com/apps/renovate) is configured for your account or repo. From 72caf2d7baaa56bb5638dfd71e60e42de014e12f Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Thu, 26 Dec 2024 23:08:25 +0000 Subject: [PATCH 09/11] Update mcr.microsoft.com/dotnet/sdk Docker tag to v9.0.101 --- .devcontainer/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile index 42fd12a..3674e18 100644 --- a/.devcontainer/Dockerfile +++ b/.devcontainer/Dockerfile @@ -1,5 +1,5 @@ # Refer to https://hub.docker.com/_/microsoft-dotnet-sdk for available versions -FROM mcr.microsoft.com/dotnet/sdk:9.0.100-noble +FROM mcr.microsoft.com/dotnet/sdk:9.0.101-noble # Installing mono makes `dotnet test` work without errors even for net472. # But installing it takes a long time, so it's excluded by default. From b353d1fb965bd85f73fee096eda88de20ae206dc Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Thu, 26 Dec 2024 23:08:30 +0000 Subject: [PATCH 10/11] Update dependency ubuntu to v24 --- .github/workflows/release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index ed0f592..766ebaf 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -17,7 +17,7 @@ permissions: jobs: release: - runs-on: ubuntu-22.04 + runs-on: ubuntu-24.04 steps: - name: โš™๏ธ Initialization shell: pwsh From 147f846d07821941e3c40f8ba8747d2bd62fa76b Mon Sep 17 00:00:00 2001 From: Andrew Arnott Date: Thu, 26 Dec 2024 18:00:17 -0700 Subject: [PATCH 11/11] Drop renovate PR hourly limit back to default --- .github/renovate.json | 1 - README.md | 2 ++ 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/renovate.json b/.github/renovate.json index a9fbeb2..498ca42 100644 --- a/.github/renovate.json +++ b/.github/renovate.json @@ -4,7 +4,6 @@ "config:recommended" ], "semanticCommits": "disabled", - "prHourlyLimit": 5, "labels": ["dependencies"], "packageRules": [ { diff --git a/README.md b/README.md index 33ddbfa..610e650 100644 --- a/README.md +++ b/README.md @@ -37,6 +37,8 @@ Further customize your repo by: 1. Verify the license is suitable for your goal as it appears in the LICENSE and stylecop.json files and the Directory.Build.props file's `PackageLicenseExpression` property. 1. Reset or replace the badges at the top of this file. +[Activate Renovate automated dependency updates](https://docs.renovatebot.com/getting-started/installing-onboarding/) for your repo. + ### Maintaining your repo based on this template The best way to keep your repo in sync with this template's evolving features and best practices is to periodically merge the template into your repo: