From f257d126c18dee6365f8ecd665eb7f7749f5ea6e Mon Sep 17 00:00:00 2001 From: Andrew Arnott Date: Fri, 27 Dec 2024 18:11:55 -0700 Subject: [PATCH] Delete azure-pipelines folder --- azure-pipelines/Merge-CodeCoverage.ps1 | 51 -------- azure-pipelines/build.yml | 69 ----------- azure-pipelines/dotnet.yml | 91 -------------- azure-pipelines/install-dependencies.yml | 30 ----- azure-pipelines/libtemplate-update.yml | 146 ----------------------- azure-pipelines/publish-codecoverage.yml | 16 --- azure-pipelines/publish-deployables.yml | 25 ---- azure-pipelines/publish_artifacts.ps1 | 45 ------- azure-pipelines/release.yml | 74 ------------ azure-pipelines/xplattest-pipeline.yml | 80 ------------- 10 files changed, 627 deletions(-) delete mode 100644 azure-pipelines/Merge-CodeCoverage.ps1 delete mode 100644 azure-pipelines/build.yml delete mode 100644 azure-pipelines/dotnet.yml delete mode 100644 azure-pipelines/install-dependencies.yml delete mode 100644 azure-pipelines/libtemplate-update.yml delete mode 100644 azure-pipelines/publish-codecoverage.yml delete mode 100644 azure-pipelines/publish-deployables.yml delete mode 100644 azure-pipelines/publish_artifacts.ps1 delete mode 100644 azure-pipelines/release.yml delete mode 100644 azure-pipelines/xplattest-pipeline.yml 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