diff --git a/azure-pipelines/SignClient.json b/.github/SignClient.json
similarity index 100%
rename from azure-pipelines/SignClient.json
rename to .github/SignClient.json
diff --git a/.github/actions/publish-artifacts/action.yaml b/.github/actions/publish-artifacts/action.yaml
index 228b6404d..bbfcc6022 100644
--- a/.github/actions/publish-artifacts/action.yaml
+++ b/.github/actions/publish-artifacts/action.yaml
@@ -65,3 +65,9 @@ runs:
name: deployables-${{ runner.os }}
path: ${{ runner.temp }}/_artifacts/deployables
if: always()
+ - name: ๐ข Upload deployables-LKG
+ uses: actions/upload-artifact@v4
+ with:
+ name: deployables-LKG-${{ runner.os }}
+ path: ${{ runner.temp }}/_artifacts/deployables-LKG
+ if: always()
diff --git a/azure-pipelines/signfiles.txt b/.github/signfiles.txt
similarity index 100%
rename from azure-pipelines/signfiles.txt
rename to .github/signfiles.txt
diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml
new file mode 100644
index 000000000..0a88b0a38
--- /dev/null
+++ b/.github/workflows/build.yml
@@ -0,0 +1,290 @@
+name: ๐ญ Build
+
+on:
+ push:
+ branches:
+ - main
+ - 'v*.*'
+ - validate/*
+ pull_request:
+ workflow_dispatch:
+
+env:
+ DOTNET_SKIP_FIRST_TIME_EXPERIENCE: true
+ BUILDCONFIGURATION: Release
+ # codecov_token: 4dc9e7e2-6b01-4932-a180-847b52b43d35 # Get a new one from https://codecov.io/
+ NUGET_PACKAGES: ${{ github.workspace }}/.nuget/packages/
+
+# dotnetfoundation code signing
+
+jobs:
+ build:
+ name: ๐ญ Build
+
+ runs-on: ${{ matrix.os }}
+ strategy:
+ fail-fast: false
+ matrix:
+ os:
+ - ubuntu-22.04
+ - windows-2022
+
+ steps:
+ - uses: actions/checkout@v4
+ with:
+ fetch-depth: 0 # avoid shallow clone so nbgv can do its work.
+ submodules: true
+ - name: โ Install prerequisites
+ run: |
+ ./init.ps1 -UpgradePrerequisites
+ dotnet --info
+
+ # Print mono version if it is present.
+ if (Get-Command mono -ErrorAction SilentlyContinue) {
+ mono --version
+ }
+ shell: pwsh
+ - name: โ Install 32-bit .NET SDK and runtimes
+ shell: pwsh
+ run: |
+ Invoke-WebRequest -Uri "https://dot.net/v1/dotnet-install.ps1" -OutFile dotnet-install.ps1
+ & .\dotnet-install.ps1 -Architecture x86 -Version 9.0.101 -InstallDir "C:\Program Files (x86)\dotnet\" -NoPath -Verbose
+ if: runner.os == 'Windows'
+ - name: โ๏ธ Set pipeline variables based on source
+ 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"
+ - name: ๐ ๏ธ Build LKG package
+ run: dotnet pack -c ${{ env.BUILDCONFIGURATION }} --no-build -p:PackLKG=true /bl:"${{ runner.temp }}/_artifacts/build_logs/msbuild_lkg.binlog"
+ working-directory: src/Nerdbank.GitVersioning.Tasks
+ - name: ๐ข Publish nbgv tool
+ run: dotnet publish -c ${{ env.BUILDCONFIGURATION }} -o ../nerdbank-gitversioning.npm/out/nbgv.cli/tools/net8.0/any /bl:"${{ runner.temp }}/_artifacts/build_logs/nbgv_publish.binlog"
+ working-directory: src/nbgv
+ - name: ๐ ๏ธ Build nerdbank-gitversioning NPM package
+ run: yarn build
+ working-directory: src/nerdbank-gitversioning.npm
+ - name: Capture .git directory
+ shell: pwsh
+ run: |
+ md ${{ runner.temp }}\_artifacts\drop
+ 7z a ${{ runner.temp }}\_artifacts\drop\nbgv.7z * -r
+ Write-Host "##vso[artifact.upload containerfolder=drop;artifactname=drop;]${{ runner.temp }}\_artifacts\drop"
+ if: failure() && runner.os == 'Windows'
+ - name: ๐งช test
+ run: |
+ Write-Host "โ๏ธ Configure git commit author for testing"
+ git config --global user.name ci
+ git config --global user.email me@ci.com
+
+ Write-Host "๐งช Run tests"
+ tools/dotnet-test-cloud.ps1 -Configuration ${{ env.BUILDCONFIGURATION }} -Agent ${{ runner.os }} -PublishResults
+ shell: pwsh
+ - name: ๐งช test x86
+ run: tools/dotnet-test-cloud.ps1 -Configuration ${{ env.BUILDCONFIGURATION }} -Agent ${{ runner.os }} -PublishResults -X86
+ if: success() && runner.os == 'Windows'
+ - name: ๐
๐ป Verify formatted code
+ run: dotnet format --verify-no-changes --no-restore
+ shell: pwsh
+ if: runner.os == 'Linux'
+ - name: ๐ Verify docfx build
+ run: dotnet docfx docfx/docfx.json --warningsAsErrors --disableGitFeatures
+ if: runner.os == 'Linux'
+ - name: โ Update pipeline variables based on build outputs
+ run: tools/variables/_define.ps1
+ shell: pwsh
+ - name: ๐ข Publish artifacts
+ uses: ./.github/actions/publish-artifacts
+ if: cancelled() == false
+ - name: ๐ฆ Push CI package
+ shell: pwsh
+ run: |
+ if ('${{ secrets.AZP_TOKEN }}') {
+ dotnet nuget add source https://pkgs.dev.azure.com/andrewarnott/OSS/_packaging/PublicCI/nuget/v3/index.json -n publicCI -u andrewarnott -p ${{ secrets.AZP_TOKEN }} --store-password-in-clear-text
+ dotnet nuget push ${{ runner.temp }}\_artifacts\deployables\*.nupkg -s publicCI -k x
+ dotnet nuget push ${{ runner.temp }}\_artifacts\deployables-LKG\*.nupkg -s publicCI -k x
+ }
+ if: success() && runner.os == 'Windows' && github.event_name != 'pull_request'
+ continue-on-error: true
+ - name: ๐ข Publish code coverage results to codecov.io
+ 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
+ if: env.codecov_token != ''
+
+ functional_testing:
+ name: ๐งช Functional testing
+ needs: build
+ runs-on: ${{ matrix.os }}
+
+ strategy:
+ fail-fast: false
+ matrix:
+ include:
+ - os: ubuntu-22.04
+ container: mcr.microsoft.com/dotnet/sdk:8.0-jammy
+ - os: ubuntu-22.04
+ container: mcr.microsoft.com/dotnet/sdk:9.0-noble
+ - os: ubuntu-22.04
+ container: mcr.microsoft.com/dotnet/sdk:8.0
+ - os: ubuntu-22.04
+ container: mcr.microsoft.com/dotnet/sdk:9.0
+ - os: macos-14
+ container: ""
+
+ # This uses a matrix value for the container; macOS will have an empty string, which means no container.
+ container:
+ image: ${{ matrix.container }}
+ # GitHub Actions will ignore an empty image automatically.
+
+ steps:
+ - name: Show .NET SDK info
+ shell: pwsh
+ run: dotnet --info
+
+ - name: Download Build Artifacts
+ uses: actions/download-artifact@v4
+ with:
+ name: deployables-Windows
+ path: deployables
+
+ - name: Set up git username and email address
+ shell: pwsh
+ run: |
+ git config --global init.defaultBranch main
+ git config --global user.name ci
+ git config --global user.email me@ci.com
+
+ - name: Consume NB.GV from .NET build
+ shell: bash
+ run: >
+ PkgFileName=$(ls deployables/Nerdbank.GitVersioning.*nupkg)
+
+ NBGV_NuGetPackageVersion=$([[ $PkgFileName =~ Nerdbank.GitVersioning\.(.*)\.nupkg ]] && echo "${BASH_REMATCH[1]}")
+
+ echo "" > nuget.config &&
+ dotnet new classlib -o lib &&
+ cd lib &&
+ echo '{"version":"42.42"}' > version.json &&
+ git init &&
+ git add version.json &&
+ git commit -m "Initial commit" &&
+ mkdir lib && cd lib &&
+ for l in c# f# vb;
+ do
+ echo Testing language $l &&
+ dotnet new classlib -lang=$l &&
+ dotnet add package nerdbank.gitversioning -v $NBGV_NuGetPackageVersion &&
+ dotnet pack -c debug /p:TreatWarningsAsErrors=false &&
+ ls bin/debug/lib.42.42.1*.nupkg 1> /dev/null 2>&1 &&
+ rm -r *
+ if [ $? -ne 0 ]; then exit 1; fi
+ done
+
+ - name: Consume Cake.GitVersioning
+ shell: bash
+ run: >
+ PkgFileName=$(ls deployables/Cake.GitVersioning.*nupkg)
+
+ NBGV_NuGetPackageVersion=$([[ $PkgFileName =~ Cake.GitVersioning\.(.*)\.nupkg ]] && echo "${BASH_REMATCH[1]}")
+
+ echo $NBGV_NuGetPackageVersion
+
+ mkdir caketest &&
+ cd caketest &&
+ git init &&
+ dotnet new tool-manifest &&
+ dotnet tool install Cake.Tool
+
+ echo "#addin nuget:?package=Cake.GitVersioning&version=${NBGV_NuGetPackageVersion}&prerelease=true"
+
+ echo "#addin nuget:?package=Cake.GitVersioning&version=${NBGV_NuGetPackageVersion}&prerelease=true" > build.cake
+
+ echo "Information(GitVersioningGetVersion().Version.ToString());" >> build.cake
+
+ dotnet cake
+
+ - name: Use nbgv dotnet CLI tool
+ shell: bash
+ run: >
+ echo DOTNET_ROOT=$DOTNET_ROOT
+
+ PkgFileName=$(ls deployables/Nerdbank.GitVersioning.*nupkg)
+
+ NBGV_NuGetPackageVersion=$([[ $PkgFileName =~ Nerdbank.GitVersioning\.(.*)\.nupkg ]] && echo "${BASH_REMATCH[1]}")
+
+ dotnet tool install nbgv --tool-path . --version $NBGV_NuGetPackageVersion --add-source deployables-Windows &&
+ ./nbgv get-version -f json -p lib &&
+ ./nbgv get-version -f json -p lib | grep 42.42.1
+
+ perf_testing:
+ name: ๐ซ Performance testing
+
+ runs-on: ${{ matrix.os }}
+ strategy:
+ fail-fast: false
+ matrix:
+ include:
+ - os: ubuntu-22.04
+ repoDir: '~/git'
+ - os: windows-2022
+ repoDir: '${USERPROFILE}/source/repos'
+ - os: macos-14
+ repoDir: '~/git'
+
+ steps:
+ - uses: actions/checkout@v4
+ with:
+ fetch-depth: 0 # avoid shallow clone so nbgv can do its work.
+ submodules: true
+
+ - name: Install .NET SDK
+ uses: actions/setup-dotnet@v2
+ with:
+ global-json-file: global.json
+
+ - name: Show .NET SDK info
+ run: dotnet --info
+
+ - name: Clone test repos
+ shell: bash
+ run: |
+ mkdir -p ${{ matrix.repoDir }}
+ git clone https://github.com/xunit/xunit ${{ matrix.repoDir }}/xunit
+ git clone https://github.com/gimlichael/Cuemon ${{ matrix.repoDir }}/Cuemon
+ git clone https://github.com/kerryjiang/SuperSocket ${{ matrix.repoDir }}/SuperSocket
+ git clone https://github.com/dotnet/Nerdbank.GitVersioning ${{ matrix.repoDir }}/Nerdbank.GitVersioning
+
+ - name: Build in Release mode
+ run: dotnet build -c Release
+ working-directory: test/Nerdbank.GitVersioning.Benchmarks
+
+ - name: Run benchmarks (packed)
+ run: dotnet run -c Release -f net9.0 --no-build -- --filter '*GetVersionBenchmarks*' --artifacts ${{ runner.temp }}/_artifacts//benchmarks/packed/${{ matrix.os }}
+ working-directory: test/Nerdbank.GitVersioning.Benchmarks
+
+ - name: Unpack Git repositories
+ shell: bash
+ run: |
+ cd ${{ matrix.repoDir }}/xunit
+ git unpack-objects < .git/objects/pack/*.pack
+
+ cd ${{ matrix.repoDir }}/Cuemon
+ git unpack-objects < .git/objects/pack/*.pack
+
+ cd ${{ matrix.repoDir }}/SuperSocket
+ git unpack-objects < .git/objects/pack/*.pack
+
+ cd ${{ matrix.repoDir }}/Nerdbank.GitVersioning
+ git unpack-objects < .git/objects/pack/*.pack
+
+ - name: Run benchmarks (unpacked)
+ run: dotnet run -c Release -f net9.0 --no-build -- --filter '*GetVersionBenchmarks*' --artifacts ${{ runner.temp }}/_artifacts//benchmarks/unpacked/${{ matrix.os }}
+ working-directory: test/Nerdbank.GitVersioning.Benchmarks
+
+ - name: Publish benchmarks artifacts
+ uses: actions/upload-artifact@v4
+ with:
+ name: benchmarks-${{ matrix.os }}
+ path: ${{ runner.temp }}/_artifacts/benchmarks
diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml
index 766ebaf56..4120561f0 100644
--- a/.github/workflows/release.yml
+++ b/.github/workflows/release.yml
@@ -19,6 +19,8 @@ jobs:
release:
runs-on: ubuntu-24.04
steps:
+ - uses: actions/checkout@v4
+
- name: โ๏ธ Initialization
shell: pwsh
run: |
@@ -67,11 +69,26 @@ jobs:
- name: ๐ป Download deployables artifacts
uses: actions/download-artifact@v4
with:
- name: deployables-Linux
+ name: deployables-Windows
path: ${{ runner.temp }}/deployables
run-id: ${{ steps.findrunid.outputs.runid }}
github-token: ${{ github.token }}
+ - name: ๐ Code sign
+ shell: pwsh
+ run: >
+ dotnet tool install --tool-path obj SignClient
+
+ obj/SignClient sign
+ --baseDirectory '${{ runner.temp }}/deployables'
+ --input '**/*'
+ --config '${{ github.workspace }}/.github/SignClient.json'
+ --filelist '${{ github.workspace }}/.github/signfiles.txt'
+ --user '${{ secrets.CODESIGN_USERNAME }}'
+ --secret '${{ secrets.CODESIGN_SECRET }}'
+ --name 'Nerdbank.GitVersioning'
+ --descriptionUrl 'https://github.com/dotnet/Nerdbank.GitVersioning'
+
- name: ๐ฝ Upload artifacts to release
shell: pwsh
if: ${{ github.event.release.assets_url }} != ''
@@ -86,3 +103,12 @@ jobs:
- name: ๐ Push NuGet packages
run: dotnet nuget push ${{ runner.temp }}/deployables/*.nupkg --source https://api.nuget.org/v3/index.json -k '${{ secrets.NUGET_API_KEY }}'
if: ${{ env.NUGET_API_KEY_DEFINED == 'true' }}
+
+ - name: ๐ Push NPM packages
+ run: |
+ npm config set //registry.npmjs.org/:_authToken=${{ secrets.NPM_API_KEY }}
+ Get-ChildItem '${{ runner.temp }}/deployables/*.tgz' |% {
+ npm publish $_ --registry=https://registry.npmjs.org/
+ }
+ env:
+ NPM_AUTH_TOKEN: ${{ secrets.NPM_API_KEY }}
diff --git a/README.md b/README.md
index 47b9e0439..584420872 100644
--- a/README.md
+++ b/README.md
@@ -1,6 +1,6 @@
๏ปฟ# Nerdbank.GitVersioning
-[](https://dev.azure.com/andrewarnott/OSS/_build/latest?definitionId=18)
+[](https://github.com/dotnet/Nerdbank.GitVersioning/actions/workflows/build.yml)
[](https://nuget.org/packages/Nerdbank.GitVersioning)
[](https://nuget.org/packages/Nerdbank.GitVersioning)
[](https://www.npmjs.com/package/nerdbank-gitversioning)
diff --git a/azure-pipelines.yml b/azure-pipelines.yml
deleted file mode 100644
index 7efbb2529..000000000
--- a/azure-pipelines.yml
+++ /dev/null
@@ -1,155 +0,0 @@
-trigger:
- batch: true
- branches:
- include:
- - main
- - 'v*.*'
- - 'validate/*'
- paths:
- exclude:
- - doc/
- - '*.md'
- - .vscode/
- - .github/
- - azure-pipelines/release.yml
-
-parameters:
-- name: RunTests
- displayName: Run tests
- type: boolean
- default: true
-
-resources:
- containers:
- - container: jammy80
- image: mcr.microsoft.com/dotnet/sdk:8.0-jammy
- - container: noble90
- image: mcr.microsoft.com/dotnet/sdk:9.0-noble
- - container: debian80
- image: mcr.microsoft.com/dotnet/sdk:8.0
- - container: debian90
- image: mcr.microsoft.com/dotnet/sdk:9.0
-
-variables:
- DOTNET_SKIP_FIRST_TIME_EXPERIENCE: true
- BuildConfiguration: Release
- codecov_token: 92266a45-648d-454e-8fec-beffae2e6553
- ci_feed: https://pkgs.dev.azure.com/andrewarnott/OSS/_packaging/PublicCI/nuget/v3/index.json
- ci_npm_feed: https://pkgs.dev.azure.com/andrewarnott/OSS/_packaging/PublicCI/npm/registry/
- NUGET_PACKAGES: $(Agent.TempDirectory)/.nuget/packages/
-
-stages:
-- stage: Build
- jobs:
- - template: azure-pipelines/build.yml
- parameters:
- RunTests: ${{ parameters.RunTests }}
-
-- stage: Test
- displayName: Functional testing
- condition: and(succeeded(), ${{ parameters.RunTests }})
- jobs:
- - job: linux
- strategy:
- matrix:
- Ubuntu_Jammy_80:
- containerImage: jammy80
- testCake: true
- Ubuntu_Noble_90:
- containerImage: noble90
- testCake: true
- Debian_80:
- containerImage: debian80
- testCake: true
- Debian_90:
- containerImage: debian90
- testCake: true
- pool:
- vmImage: ubuntu-22.04
- container: $[ variables['containerImage'] ]
- steps:
- - bash: $(configureContainerCommand)
- displayName: Configure container
- condition: ne(variables['configureContainerCommand'], '')
- - template: azure-pipelines/xplattest-pipeline.yml
-
- - job: macOS
- strategy:
- matrix:
- macOS_Catalina:
- vmImage: macOS-14
- macOS_Monterey:
- vmImage: macOS-14
- pool:
- vmImage: $[ variables['vmImage'] ]
- steps:
- - template: azure-pipelines/xplattest-pipeline.yml
-
-- stage: PerfAnalysis
- displayName: Perf analysis
- dependsOn: []
- jobs:
- - job: PerfTest
- strategy:
- matrix:
- ubuntu:
- imageName: ubuntu-22.04
- repoDir: '~/git'
- windows:
- imageName: windows-2022
- repoDir: '${USERPROFILE}/source/repos'
- macOS:
- imageName: macOS-14
- repoDir: '~/git'
- pool:
- vmImage: $(imageName)
- steps:
- - checkout: self
- fetchDepth: 0 # avoid shallow clone so nbgv can do its work.
- clean: true
- submodules: true # keep the warnings quiet about the wiki not being enlisted
- - task: UseDotNet@2
- displayName: Install .NET 9.0.101 SDK
- inputs:
- packageType: sdk
- version: 9.0.101
- - script: dotnet --info
- displayName: Show dotnet SDK info
- - bash: |
- mkdir -p $(repoDir)
- git clone https://github.com/xunit/xunit $(repoDir)/xunit
- git clone https://github.com/gimlichael/Cuemon $(repoDir)/Cuemon
- git clone https://github.com/kerryjiang/SuperSocket $(repoDir)/SuperSocket
- git clone https://github.com/dotnet/Nerdbank.GitVersioning $(repoDir)/Nerdbank.GitVersioning
- displayName: Clone test repositories
- - script: |
- dotnet build -c Release
- displayName: Build in Release mode
- - script: |
- dotnet run -c Release -f net9.0 -- --filter *GetVersionBenchmarks* --artifacts $(Build.ArtifactStagingDirectory)/benchmarks/packed/$(imageName)
- workingDirectory: test/Nerdbank.GitVersioning.Benchmarks
- displayName: Run benchmarks (packed)
- - bash: |
- cd $(repoDir)/xunit
- git unpack-objects < .git/objects/pack/*.pack
-
- cd $(repoDir)/Cuemon
- git unpack-objects < .git/objects/pack/*.pack
-
- cd $(repoDir)/SuperSocket
- git unpack-objects < .git/objects/pack/*.pack
-
- cd $(repoDir)/Nerdbank.GitVersioning
- git unpack-objects < .git/objects/pack/*.pack
- displayName: Unpack Git repositories
- - script: |
- dotnet run -c Release -f net9.0 -- --filter '*GetVersionBenchmarks*' --artifacts $(Build.ArtifactStagingDirectory)/benchmarks/unpacked/$(imageName)
- workingDirectory: test/Nerdbank.GitVersioning.Benchmarks
- displayName: Run benchmarks (unpacked)
- - task: PublishBuildArtifacts@1
- inputs:
- PathtoPublish: $(Build.ArtifactStagingDirectory)/benchmarks
- ArtifactName: benchmarks
- ArtifactType: Container
- displayName: Publish benchmarks artifacts
- condition: succeededOrFailed()
diff --git a/azure-pipelines/Merge-CodeCoverage.ps1 b/azure-pipelines/Merge-CodeCoverage.ps1
deleted file mode 100644
index 308f57546..000000000
--- a/azure-pipelines/Merge-CodeCoverage.ps1
+++ /dev/null
@@ -1,51 +0,0 @@
-#!/usr/bin/env pwsh
-
-<#
-.SYNOPSIS
- Merges code coverage reports.
-.PARAMETER Path
- The path(s) to search for Cobertura code coverage reports.
-.PARAMETER Format
- The format for the merged result. The default is Cobertura
-.PARAMETER OutputDir
- The directory the merged result will be written to. The default is `coveragereport` in the root of this repo.
-#>
-[CmdletBinding()]
-Param(
- [Parameter(Mandatory=$true)]
- [string[]]$Path,
- [ValidateSet('Badges', 'Clover', 'Cobertura', 'CsvSummary', 'Html', 'Html_Dark', 'Html_Light', 'HtmlChart', 'HtmlInline', 'HtmlInline_AzurePipelines', 'HtmlInline_AzurePipelines_Dark', 'HtmlInline_AzurePipelines_Light', 'HtmlSummary', 'JsonSummary', 'Latex', 'LatexSummary', 'lcov', 'MarkdownSummary', 'MHtml', 'PngChart', 'SonarQube', 'TeamCitySummary', 'TextSummary', 'Xml', 'XmlSummary')]
- [string]$Format='Cobertura',
- [string]$OutputFile=("$PSScriptRoot/../coveragereport/merged.cobertura.xml")
-)
-
-$RepoRoot = [string](Resolve-Path $PSScriptRoot/..)
-Push-Location $RepoRoot
-try {
- Write-Verbose "Searching $Path for *.cobertura.xml files"
- $reports = Get-ChildItem -Recurse $Path -Filter *.cobertura.xml
-
- if ($reports) {
- $reports |% { $_.FullName } |% {
- # In addition to replacing {reporoot}, we also normalize on one kind of slash so that the report aggregates data for a file whether data was collected on Windows or not.
- $xml = [xml](Get-Content -LiteralPath $_)
- $xml.coverage.packages.package.classes.class |? { $_.filename} |% {
- $_.filename = $_.filename.Replace('{reporoot}', $RepoRoot).Replace([IO.Path]::AltDirectorySeparatorChar, [IO.Path]::DirectorySeparatorChar)
- }
-
- $xml.Save($_)
- }
-
- $Inputs = $reports |% { Resolve-Path -relative $_.FullName }
-
- if ((Split-Path $OutputFile) -and -not (Test-Path (Split-Path $OutputFile))) {
- New-Item -Type Directory -Path (Split-Path $OutputFile) | Out-Null
- }
-
- & dotnet tool run dotnet-coverage merge $Inputs -o $OutputFile -f cobertura
- } else {
- Write-Error "No reports found to merge."
- }
-} finally {
- Pop-Location
-}
diff --git a/azure-pipelines/build.yml b/azure-pipelines/build.yml
deleted file mode 100644
index 7ac7cc0f6..000000000
--- a/azure-pipelines/build.yml
+++ /dev/null
@@ -1,69 +0,0 @@
-parameters:
-- name: windowsPool
- type: object
- default:
- vmImage: windows-2022
-- name: RunTests
- type: boolean
- default: true
-
-jobs:
-- job: Windows
- pool: ${{ parameters.windowsPool }}
- variables:
- - name: testModifier
- value:
- - ${{ if eq(variables['System.TeamFoundationCollectionUri'], 'https://dev.azure.com/andrewarnott/') }}:
- - group: dotnetfoundation code signing
- steps:
- - checkout: self
- fetchDepth: 0 # avoid shallow clone so nbgv can do its work.
- clean: true
- submodules: true # keep the warnings quiet about the wiki not being enlisted
- - template: install-dependencies.yml
- - pwsh: |
- Invoke-WebRequest -Uri "https://dot.net/v1/dotnet-install.ps1" -OutFile dotnet-install.ps1
- & .\dotnet-install.ps1 -Architecture x86 -Version 9.0.101 -InstallDir "C:\Program Files (x86)\dotnet\" -NoPath -Verbose
- displayName: โ Install 32-bit .NET SDK and runtimes
-
- - template: dotnet.yml
- parameters:
- RunTests: ${{ parameters.RunTests }}
-
-- job: Linux
- pool:
- vmImage: Ubuntu-22.04
- steps:
- - checkout: self
- fetchDepth: 0 # avoid shallow clone so nbgv can do its work.
- clean: true
- submodules: true # keep the warnings quiet about the wiki not being enlisted
- - template: install-dependencies.yml
- - powershell: dotnet tool run nbgv cloud -c
- displayName: โ Set build number
- - template: dotnet.yml
- parameters:
- RunTests: ${{ parameters.RunTests }}
- - script: dotnet format --verify-no-changes
- displayName: ๐
Verify formatted code
- env:
- dotnetformat: true # part of a workaround for https://github.com/dotnet/sdk/issues/44951
- - script: dotnet docfx docfx/docfx.json --warningsAsErrors --disableGitFeatures
- displayName: ๐ Verify docfx build
-
-- job: WrapUp
- dependsOn:
- - Windows
- - Linux
- pool: ${{ parameters.windowsPool }} # Use Windows agent because PublishSymbols task requires it (https://github.com/microsoft/azure-pipelines-tasks/issues/13821).
- condition: succeededOrFailed()
- steps:
- - checkout: self
- fetchDepth: 0 # avoid shallow clone so nbgv can do its work.
- clean: true
- - template: install-dependencies.yml
- parameters:
- initArgs: -NoRestore
- - ${{ if parameters.RunTests }}:
- - template: publish-codecoverage.yml
- - template: publish-deployables.yml
diff --git a/azure-pipelines/dotnet.yml b/azure-pipelines/dotnet.yml
deleted file mode 100644
index 262c4878f..000000000
--- a/azure-pipelines/dotnet.yml
+++ /dev/null
@@ -1,91 +0,0 @@
-parameters:
- RunTests:
-
-steps:
-
-- script: |
- git config --global user.name ci
- git config --global user.email me@ci.com
- displayName: โ๏ธ Configure git commit author for testing
-
-- 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
-
-- script: dotnet pack -c $(BuildConfiguration) --no-build -p:PackLKG=true /bl:"$(Build.ArtifactStagingDirectory)/build_logs/msbuild_lkg.binlog"
- displayName: ๐ ๏ธ Build LKG package
- workingDirectory: src/Nerdbank.GitVersioning.Tasks
-
-- script: dotnet publish -c $(BuildConfiguration) -o ../nerdbank-gitversioning.npm/out/nbgv.cli/tools/net8.0/any /bl:"$(Build.ArtifactStagingDirectory)/build_logs/nbgv_publish.binlog"
- displayName: ๐ข Publish nbgv tool
- workingDirectory: src/nbgv
-
-- script: yarn build
- displayName: ๐ ๏ธ Build nerdbank-gitversioning NPM package
- workingDirectory: src/nerdbank-gitversioning.npm
-
-- pwsh: |
- md $(Build.ArtifactStagingDirectory)\drop
- 7z a $(Build.ArtifactStagingDirectory)\drop\nbgv.7z * -r
- Write-Host "##vso[artifact.upload containerfolder=drop;artifactname=drop;]$(Build.ArtifactStagingDirectory)\drop"
- displayName: Capture .git directory
- condition: and(failed(), eq(variables['Agent.OS'], 'Windows_NT'))
-
-- powershell: tools/dotnet-test-cloud.ps1 -Configuration $(BuildConfiguration) -Agent $(Agent.JobName) -PublishResults
- displayName: ๐งช dotnet test
- condition: and(succeeded(), ${{ parameters.RunTests }})
-
-- powershell: tools/dotnet-test-cloud.ps1 -Configuration $(BuildConfiguration) -Agent $(Agent.JobName) -PublishResults -X86
- displayName: ๐งช dotnet test x86
- condition: and(succeeded(), eq(variables['Agent.OS'], 'Windows_NT'))
-
-- powershell: azure-pipelines/publish_artifacts.ps1 -ArtifactNameSuffix "-$(Agent.JobName)" -StageOnly
- failOnStderr: true
- displayName: ๐๏ธ Stage artifacts
- condition: succeededOrFailed()
-
-- pwsh: >
- dotnet tool install --tool-path obj SignClient
-
- obj/SignClient sign
- --baseDirectory '$(Build.ArtifactStagingDirectory)/deployables-Windows'
- --input '**/*'
- --config '$(System.DefaultWorkingDirectory)/azure-pipelines/SignClient.json'
- --filelist '$(System.DefaultWorkingDirectory)/azure-pipelines/signfiles.txt'
- --user '$(codesign_username)'
- --secret '$(codesign_secret)'
- --name 'Nerdbank.GitVersioning'
- --descriptionUrl 'https://github.com/dotnet/Nerdbank.GitVersioning'
- displayName: ๐ Code sign
- condition: and(succeeded(), eq(variables['System.TeamFoundationCollectionUri'], 'https://dev.azure.com/andrewarnott/'), eq(variables['Agent.OS'], 'Windows_NT'), ne(variables['Build.Reason'], 'PullRequest'))
-
-- pwsh: >
- obj/SignClient sign
- --baseDirectory '$(Build.ArtifactStagingDirectory)/deployables-LKG-Windows'
- --input '**/*'
- --config '$(System.DefaultWorkingDirectory)/azure-pipelines/SignClient.json'
- --filelist '$(System.DefaultWorkingDirectory)/azure-pipelines/signfiles.txt'
- --user '$(codesign_username)'
- --secret '$(codesign_secret)'
- --name 'Nerdbank.GitVersioning'
- --descriptionUrl 'https://github.com/dotnet/Nerdbank.GitVersioning'
- displayName: ๐ Code sign LKG
- condition: and(succeeded(), eq(variables['System.TeamFoundationCollectionUri'], 'https://dev.azure.com/andrewarnott/'), eq(variables['Agent.OS'], 'Windows_NT'), ne(variables['Build.Reason'], 'PullRequest'))
-
-- powershell: tools/variables/_define.ps1
- failOnStderr: true
- displayName: โ Update pipeline variables based on build outputs
- condition: succeededOrFailed()
-
-- powershell: azure-pipelines/publish_artifacts.ps1 -ArtifactNameSuffix "-$(Agent.JobName)" -Verbose
- failOnStderr: true
- displayName: ๐ข Publish artifacts
- condition: succeededOrFailed()
-
-- ${{ if and(ne(variables['codecov_token'], ''), parameters.RunTests) }}:
- - powershell: |
- $ArtifactStagingFolder = & "tools/Get-ArtifactsStagingDirectory.ps1"
- $CoverageResultsFolder = Join-Path $ArtifactStagingFolder "coverageResults-$(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/install-dependencies.yml b/azure-pipelines/install-dependencies.yml
deleted file mode 100644
index 7af026cd8..000000000
--- a/azure-pipelines/install-dependencies.yml
+++ /dev/null
@@ -1,30 +0,0 @@
-parameters:
- initArgs:
-
-steps:
-
-- task: NodeTool@0
- inputs:
- versionSpec: 20.x
- displayName: โ๏ธ Install Node.js
-
-- task: NuGetAuthenticate@1
- displayName: ๐ Authenticate NuGet feeds
- inputs:
- forceReinstallCredentialProvider: true
-
-- powershell: |
- $AccessToken = '$(System.AccessToken)' # Avoid specifying the access token directly on the init.ps1 command line to avoid it showing up in errors
- .\init.ps1 -AccessToken $AccessToken ${{ parameters['initArgs'] }} -UpgradePrerequisites -NoNuGetCredProvider
- dotnet --info
-
- # Print mono version if it is present.
- if (Get-Command mono -ErrorAction SilentlyContinue) {
- mono --version
- }
- displayName: โ Install prerequisites
-
-- powershell: tools/variables/_define.ps1
- failOnStderr: true
- displayName: โ Set pipeline variables based on source
- name: SetPipelineVariables
diff --git a/azure-pipelines/libtemplate-update.yml b/azure-pipelines/libtemplate-update.yml
deleted file mode 100644
index fdfa1df54..000000000
--- a/azure-pipelines/libtemplate-update.yml
+++ /dev/null
@@ -1,146 +0,0 @@
-# This pipeline schedules regular merges of Library.Template into a repo that is based on it.
-# Only Azure Repos are supported. GitHub support comes via a GitHub Actions workflow.
-
-trigger: none
-pr: none
-schedules:
-- cron: "0 3 * * Mon" # Sun @ 8 or 9 PM Mountain Time (depending on DST)
- displayName: Weekly trigger
- branches:
- include:
- - main
- always: true
-
-parameters:
-- name: AutoComplete
- displayName: Auto-complete pull request
- type: boolean
- default: false
-
-stages:
-- stage: Merge
- jobs:
- - job: merge
- pool:
- vmImage: ubuntu-latest
- steps:
- - checkout: self
- fetchDepth: 0
- clean: true
- - pwsh: |
- $LibTemplateBranch = & ./tools/Get-LibTemplateBasis.ps1 -ErrorIfNotRelated
- if ($LASTEXITCODE -ne 0) {
- exit $LASTEXITCODE
- }
-
- git fetch https://github.com/aarnott/Library.Template $LibTemplateBranch
- if ($LASTEXITCODE -ne 0) {
- exit $LASTEXITCODE
- }
- $LibTemplateCommit = git rev-parse FETCH_HEAD
-
- if ((git rev-list FETCH_HEAD ^HEAD --count) -eq 0) {
- Write-Host "There are no Library.Template updates to merge."
- exit 0
- }
-
- $UpdateBranchName = 'auto/libtemplateUpdate'
- git -c http.extraheader="AUTHORIZATION: bearer $(System.AccessToken)" push origin -f FETCH_HEAD:refs/heads/$UpdateBranchName
-
- Write-Host "Creating pull request"
- $contentType = 'application/json';
- $headers = @{ Authorization = 'Bearer $(System.AccessToken)' };
- $rawRequest = @{
- sourceRefName = "refs/heads/$UpdateBranchName";
- targetRefName = "refs/heads/main";
- title = 'Merge latest Library.Template';
- description = "This merges the latest features and fixes from [Library.Template's $LibTemplateBranch branch](https://github.com/AArnott/Library.Template/tree/$LibTemplateBranch).";
- }
- $request = ConvertTo-Json $rawRequest
-
- $prApiBaseUri = '$(System.TeamFoundationCollectionUri)/$(System.TeamProject)/_apis/git/repositories/$(Build.Repository.ID)/pullrequests'
- $prCreationUri = $prApiBaseUri + "?api-version=6.0"
- Write-Host "POST $prCreationUri"
- Write-Host $request
-
- $prCreationResult = Invoke-RestMethod -uri $prCreationUri -method POST -Headers $headers -ContentType $contentType -Body $request
- $prUrl = "$($prCreationResult.repository.webUrl)/pullrequest/$($prCreationResult.pullRequestId)"
- Write-Host "Pull request: $prUrl"
- $prApiBaseUri += "/$($prCreationResult.pullRequestId)"
-
- $SummaryPath = Join-Path '$(Agent.TempDirectory)' 'summary.md'
- Set-Content -Path $SummaryPath -Value "[Insertion pull request]($prUrl)"
- Write-Host "##vso[task.uploadsummary]$SummaryPath"
-
- # Tag the PR
- $tagUri = "$prApiBaseUri/labels?api-version=7.0"
- $rawRequest = @{
- name = 'auto-template-merge';
- }
- $request = ConvertTo-Json $rawRequest
- Invoke-RestMethod -uri $tagUri -method POST -Headers $headers -ContentType $contentType -Body $request | Out-Null
-
- # Add properties to the PR that we can programatically parse later.
- Function Set-PRProperties($properties) {
- $rawRequest = $properties.GetEnumerator() |% {
- @{
- op = 'add'
- path = "/$($_.key)"
- from = $null
- value = $_.value
- }
- }
- $request = ConvertTo-Json $rawRequest
- $setPrPropertyUri = "$prApiBaseUri/properties?api-version=7.0"
- Write-Debug "$request"
- $setPrPropertyResult = Invoke-RestMethod -uri $setPrPropertyUri -method PATCH -Headers $headers -ContentType 'application/json-patch+json' -Body $request -StatusCodeVariable setPrPropertyStatus -SkipHttpErrorCheck
- if ($setPrPropertyStatus -ne 200) {
- Write-Host "##vso[task.logissue type=warning]Failed to set pull request properties. Result: $setPrPropertyStatus. $($setPrPropertyResult.message)"
- }
- }
- Write-Host "Setting pull request properties"
- Set-PRProperties @{
- 'AutomatedMerge.SourceBranch' = $LibTemplateBranch
- 'AutomatedMerge.SourceCommit' = $LibTemplateCommit
- }
-
- # Add an *active* PR comment to warn users to *merge* the pull request instead of squash it.
- $request = ConvertTo-Json @{
- comments = @(
- @{
- parentCommentId = 0
- content = "Do **not** squash this pull request when completing it. You must *merge* it."
- commentType = 'system'
- }
- )
- status = 'active'
- }
- $result = Invoke-RestMethod -uri "$prApiBaseUri/threads?api-version=7.1" -method POST -Headers $headers -ContentType $contentType -Body $request -StatusCodeVariable addCommentStatus -SkipHttpErrorCheck
- if ($addCommentStatus -ne 200) {
- Write-Host "##vso[task.logissue type=warning]Failed to post comment on pull request. Result: $addCommentStatus. $($result.message)"
- }
-
- # Set auto-complete on the PR
- if ('${{ parameters.AutoComplete }}' -eq 'True') {
- Write-Host "Setting auto-complete"
- $mergeMessage = "Merged PR $($prCreationResult.pullRequestId): " + $commitMessage
- $rawRequest = @{
- autoCompleteSetBy = @{
- id = $prCreationResult.createdBy.id
- };
- completionOptions = @{
- deleteSourceBranch = $true;
- mergeCommitMessage = $mergeMessage;
- mergeStrategy = 'noFastForward';
- };
- }
- $request = ConvertTo-Json $rawRequest
- Write-Host $request
- $uri = "$($prApiBaseUri)?api-version=6.0"
- $result = Invoke-RestMethod -uri $uri -method PATCH -Headers $headers -ContentType $contentType -Body $request -StatusCodeVariable autoCompleteStatus -SkipHttpErrorCheck
- if ($autoCompleteStatus -ne 200) {
- Write-Host "##vso[task.logissue type=warning]Failed to set auto-complete on pull request. Result: $autoCompleteStatus. $($result.message)"
- }
- }
-
- displayName: Create pull request
diff --git a/azure-pipelines/publish-codecoverage.yml b/azure-pipelines/publish-codecoverage.yml
deleted file mode 100644
index 1c9d859ac..000000000
--- a/azure-pipelines/publish-codecoverage.yml
+++ /dev/null
@@ -1,16 +0,0 @@
-steps:
-- download: current
- artifact: coverageResults-Windows
- displayName: ๐ป Download Windows code coverage results
- continueOnError: true
-- download: current
- artifact: coverageResults-Linux
- displayName: ๐ป Download Linux code coverage results
- continueOnError: true
-- powershell: azure-pipelines/Merge-CodeCoverage.ps1 -Path '$(Pipeline.Workspace)' -OutputFile coveragereport/merged.cobertura.xml -Format Cobertura -Verbose
- displayName: โ Merge coverage
-- task: PublishCodeCoverageResults@2
- displayName: ๐ข Publish code coverage results to Azure DevOps
- inputs:
- summaryFileLocation: coveragereport/merged.cobertura.xml
- failIfCoverageEmpty: true
diff --git a/azure-pipelines/publish-deployables.yml b/azure-pipelines/publish-deployables.yml
deleted file mode 100644
index 6e5e38038..000000000
--- a/azure-pipelines/publish-deployables.yml
+++ /dev/null
@@ -1,25 +0,0 @@
-steps:
-- download: current
- displayName: ๐ป Download deployables
- artifact: deployables-Windows
-
-- powershell: dotnet nuget push "$(Resolve-Path '$(Pipeline.Workspace)\deployables-Windows\')*.nupkg" -s $(ci_feed) -k azdo --skip-duplicate
- displayName: ๐ฆ Push packages to CI feed
- condition: and(succeeded(), ne(variables['ci_feed'], ''), ne(variables['Build.Reason'], 'PullRequest'))
-
-- pwsh: Set-Content -Path "$(Agent.TempDirectory)/.npmrc" -Value "registry=$(ci_npm_feed)`nalways-auth=true"
- displayName: โ๏ธ Prepare to push to PublicCI
- condition: and(succeeded(), eq(variables['Agent.OS'], 'Windows_NT'), eq(variables['System.TeamFoundationCollectionUri'], 'https://dev.azure.com/andrewarnott/'), ne(variables['Build.Reason'], 'PullRequest'))
-- task: npmAuthenticate@0
- displayName: ๐ Authenticate to PublicCI
- inputs:
- workingFile: $(Agent.TempDirectory)/.npmrc
- condition: and(succeeded(), eq(variables['Agent.OS'], 'Windows_NT'), eq(variables['System.TeamFoundationCollectionUri'], 'https://dev.azure.com/andrewarnott/'), ne(variables['Build.Reason'], 'PullRequest'))
-- pwsh: |
- $tgz = (Get-ChildItem "$(Pipeline.Workspace)/deployables-Windows/*.tgz")[0].FullName
- Write-Host "Will publish $tgz"
- npm publish $tgz
- workingDirectory: $(Agent.TempDirectory)
- displayName: ๐ฆ npm publish to PublicCI feed
- continueOnError: true
- condition: and(succeeded(), ne(variables['ci_npm_feed'], ''), ne(variables['Build.Reason'], 'PullRequest'))
diff --git a/azure-pipelines/publish_artifacts.ps1 b/azure-pipelines/publish_artifacts.ps1
deleted file mode 100644
index 3f35cc6e1..000000000
--- a/azure-pipelines/publish_artifacts.ps1
+++ /dev/null
@@ -1,45 +0,0 @@
-<#
-.SYNOPSIS
- This script translates all the artifacts described by _all.ps1
- into commands that instruct Azure Pipelines to actually collect those artifacts.
-#>
-
-[CmdletBinding()]
-param (
- [string]$ArtifactNameSuffix,
- [switch]$StageOnly,
- [switch]$AvoidSymbolicLinks
-)
-
-Function Set-PipelineVariable($name, $value) {
- if ((Test-Path "Env:\$name") -and (Get-Item "Env:\$name").Value -eq $value) {
- return # already set
- }
-
- #New-Item -LiteralPath "Env:\$name".ToUpper() -Value $value -Force | Out-Null
- Write-Host "##vso[task.setvariable variable=$name]$value"
-}
-
-Function Test-ArtifactUploaded($artifactName) {
- $varName = "ARTIFACTUPLOADED_$($artifactName.ToUpper())"
- Test-Path "env:$varName"
-}
-
-& "$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'
- Write-Host "Staged artifact $($_.Name) to $($_.Path)"
-
- if (!$StageOnly) {
- if (Test-ArtifactUploaded $_.Name) {
- Write-Host "Skipping $($_.Name) because it has already been uploaded." -ForegroundColor DarkGray
- } else {
- Write-Host "##vso[artifact.upload containerfolder=$($_.Name);artifactname=$($_.Name);]$($_.Path)"
-
- # 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 "ARTIFACTUPLOADED_$($_.Name.ToUpper())" 'true'
- }
- }
-}
diff --git a/azure-pipelines/release.yml b/azure-pipelines/release.yml
deleted file mode 100644
index e89ac6453..000000000
--- a/azure-pipelines/release.yml
+++ /dev/null
@@ -1,74 +0,0 @@
-trigger: none # We only want to trigger manually or based on resources
-pr: none
-
-resources:
- pipelines:
- - pipeline: CI
- source: Nerdbank.GitVersioning
- trigger:
- tags:
- - auto-release
-
-variables:
-- group: Publishing secrets
-
-jobs:
-- job: release
- pool:
- vmImage: ubuntu-latest
- steps:
- - checkout: none
- - powershell: |
- Write-Host "##vso[build.updatebuildnumber]$(resources.pipeline.CI.runName)"
- if ('$(resources.pipeline.CI.runName)'.Contains('-')) {
- Write-Host "##vso[task.setvariable variable=IsPrerelease]true"
- } else {
- Write-Host "##vso[task.setvariable variable=IsPrerelease]false"
- }
- displayName: โ Set up pipeline
- - task: UseDotNet@2
- displayName: โ Install .NET SDK
- inputs:
- packageType: sdk
- version: 6.x
- - download: CI
- artifact: deployables-Windows
- displayName: ๐ป Download deployables-Windows artifact
- patterns: 'deployables-Windows/*'
- - task: GitHubRelease@1
- displayName: ๐ข GitHub release (create)
- inputs:
- gitHubConnection: github.com_AArnott_OAuth
- repositoryName: $(Build.Repository.Name)
- target: $(resources.pipeline.CI.sourceCommit)
- tagSource: userSpecifiedTag
- tag: v$(resources.pipeline.CI.runName)
- title: v$(resources.pipeline.CI.runName)
- isDraft: true # After running this step, visit the new draft release, edit, and publish.
- isPreRelease: $(IsPrerelease)
- assets: $(Pipeline.Workspace)/CI/deployables-Windows/*.nupkg
- changeLogCompareToRelease: lastNonDraftRelease
- changeLogType: issueBased
- changeLogLabels: |
- [
- { "label" : "breaking change", "displayName" : "Breaking changes", "state" : "closed" },
- { "label" : "bug", "displayName" : "Fixes", "state" : "closed" },
- { "label" : "enhancement", "displayName": "Enhancements", "state" : "closed" }
- ]
- - script: dotnet nuget push $(Pipeline.Workspace)/CI/deployables-Windows/*.nupkg -s https://api.nuget.org/v3/index.json --api-key $(NuGetOrgApiKey) --skip-duplicate
- displayName: ๐ฆ Push packages to nuget.org
- condition: and(succeeded(), ne(variables['NuGetOrgApiKey'], ''))
- - powershell: |
- $tgz = (Get-ChildItem "$(Pipeline.Workspace)/CI/deployables-Windows/*.tgz")[0].FullName
-
- npm init -y
- npm install $tgz
- workingDirectory: $(Agent.TempDirectory)
- displayName: โ๏ธ Prepare to publish NPM package
- - task: Npm@1
- displayName: ๐ฆ npm publish
- inputs:
- command: publish
- workingDir: $(Agent.TempDirectory)/node_modules/nerdbank-gitversioning
- verbose: false
- publishEndpoint: npmjs.org
diff --git a/azure-pipelines/xplattest-pipeline.yml b/azure-pipelines/xplattest-pipeline.yml
deleted file mode 100644
index 30fe90b47..000000000
--- a/azure-pipelines/xplattest-pipeline.yml
+++ /dev/null
@@ -1,80 +0,0 @@
-steps:
-- checkout: none # skip checking out the default repository resource
-
-- script: dotnet --info
- displayName: Show dotnet SDK info
-
-- task: DownloadBuildArtifacts@0
- displayName: Download Build Artifacts
- inputs:
- artifactName: deployables-Windows
- downloadPath: $(System.DefaultWorkingDirectory)
-
-- script: |
- git config --global init.defaultBranch main
- git config --global user.name ci
- git config --global user.email me@ci.com
- displayName: Set up git username and email address
-
-- script: >
- PkgFileName=$(ls deployables-Windows/Nerdbank.GitVersioning.*nupkg)
-
- NBGV_NuGetPackageVersion=$([[ $PkgFileName =~ Nerdbank.GitVersioning\.(.*)\.nupkg ]] && echo "${BASH_REMATCH[1]}")
-
- echo "" > nuget.config &&
- dotnet new classlib -o lib &&
- cd lib &&
- echo '{"version":"42.42"}' > version.json &&
- git init &&
- git add version.json &&
- git commit -m "Initial commit" &&
- mkdir lib && cd lib &&
- for l in c# f# vb;
- do
- echo Testing language $l &&
- dotnet new classlib -lang=$l &&
- dotnet add package nerdbank.gitversioning -v $NBGV_NuGetPackageVersion &&
- dotnet pack -c debug /p:TreatWarningsAsErrors=false &&
- ls bin/debug/lib.42.42.1*.nupkg 1> /dev/null 2>&1 &&
- rm -r *
- if [ $? -ne 0 ]; then exit 1; fi
- done
- displayName: Consume NB.GV from .NET Core build
- failOnStderr: true
-
-- script: >
- PkgFileName=$(ls deployables-Windows/Cake.GitVersioning.*nupkg)
-
- NBGV_NuGetPackageVersion=$([[ $PkgFileName =~ Cake.GitVersioning\.(.*)\.nupkg ]] && echo "${BASH_REMATCH[1]}")
-
- echo $NBGV_NuGetPackageVersion
-
- mkdir caketest &&
- cd caketest &&
- git init &&
- dotnet new tool-manifest &&
- dotnet tool install Cake.Tool
-
- echo "#addin nuget:?package=Cake.GitVersioning&version=${NBGV_NuGetPackageVersion}&prerelease=true"
-
- echo "#addin nuget:?package=Cake.GitVersioning&version=${NBGV_NuGetPackageVersion}&prerelease=true" > build.cake
-
- echo "Information(GitVersioningGetVersion().Version.ToString());" >> build.cake
-
- dotnet cake
- displayName: Consume Cake.GitVersioning
- condition: and(succeeded(), ne(variables.testCake, 'false'))
- failOnStderr: true
-
-- script: >
- echo DOTNET_ROOT=$DOTNET_ROOT
-
- PkgFileName=$(ls deployables-Windows/Nerdbank.GitVersioning.*nupkg)
-
- NBGV_NuGetPackageVersion=$([[ $PkgFileName =~ Nerdbank.GitVersioning\.(.*)\.nupkg ]] && echo "${BASH_REMATCH[1]}")
-
- dotnet tool install nbgv --tool-path . --version $NBGV_NuGetPackageVersion --add-source deployables-Windows &&
- ./nbgv get-version -f json -p lib &&
- ./nbgv get-version -f json -p lib | grep 42.42.1
- displayName: Use nbgv dotnet CLI tool
- failOnStderr: true
diff --git a/azurepipelines-coverage.yml b/azurepipelines-coverage.yml
deleted file mode 100644
index 0cd5dad36..000000000
--- a/azurepipelines-coverage.yml
+++ /dev/null
@@ -1,6 +0,0 @@
-# https://learn.microsoft.com/azure/devops/pipelines/test/codecoverage-for-pullrequests?view=azure-devops
-coverage:
- status:
- comments: on # add comment to PRs reporting diff in coverage of modified files
- diff: # diff coverage is code coverage only for the lines changed in a pull request.
- target: 70% # set this to a desired %. Default is 70%
diff --git a/src/Nerdbank.GitVersioning.Tasks/GetBuildVersion.cs b/src/Nerdbank.GitVersioning.Tasks/GetBuildVersion.cs
index 2a5113b69..683ff6d0e 100644
--- a/src/Nerdbank.GitVersioning.Tasks/GetBuildVersion.cs
+++ b/src/Nerdbank.GitVersioning.Tasks/GetBuildVersion.cs
@@ -239,6 +239,7 @@ protected override bool ExecuteInner()
}
ICloudBuild cloudBuild = CloudBuild.Active;
+ this.Log.LogMessage(MessageImportance.Low, "Cloud build provider: {0}", cloudBuild?.GetType().Name ?? "None");
int? overrideBuildNumberOffset = (this.OverrideBuildNumberOffset == int.MaxValue) ? (int?)null : this.OverrideBuildNumberOffset;
string projectDirectory = this.ProjectPathRelativeToGitRepoRoot is object && this.GitRepoRoot is object
? Path.Combine(this.GitRepoRoot, this.ProjectPathRelativeToGitRepoRoot)
diff --git a/test/Nerdbank.GitVersioning.Tests/BuildIntegrationTests.cs b/test/Nerdbank.GitVersioning.Tests/BuildIntegrationTests.cs
index 0758c5d04..3ca77583b 100644
--- a/test/Nerdbank.GitVersioning.Tests/BuildIntegrationTests.cs
+++ b/test/Nerdbank.GitVersioning.Tests/BuildIntegrationTests.cs
@@ -28,6 +28,7 @@ public abstract class BuildIntegrationTests : RepoTestBase, IClassFixture name.StartsWith(toxic, StringComparison.OrdinalIgnoreCase)))
{
+ Environment.SetEnvironmentVariable(name, null);
this.globalProperties[name] = string.Empty;
}
}