-
Notifications
You must be signed in to change notification settings - Fork 2.5k
(Re-)introduce release builds with Azure Pipelines #2176
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 1 commit
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
defa690
linux/{pack,layout}.sh: allow specification of output dir
mjcheetham f893082
dotnettool: translate layout+pack scripts to pwsh
mjcheetham 6e374ba
osx/codesign.sh: print entitlements file before signing
mjcheetham c098720
osx/codesign.sh: apply linter recommendations
mjcheetham 2d42fe4
.azure-pipelines/release.yml: add SDL pool info
mjcheetham 7d409d7
.azure-pipelines/release.yml: use simple build number
mjcheetham 19a6078
.azure-pipelines/release.yml: add Windows builds
mjcheetham 620c3bf
.azure-pipelines/release.yml: add macOS builds
mjcheetham 296838c
.azure-pipelines/release.yml: add Linux builds
mjcheetham 68d6cd6
.azure-pipelines/release.yml: add .NET Tool release pipeline
mjcheetham 66af950
.azure-pipelines/release.yml: add GitHub and NuGet.org publishing
mjcheetham 80ef749
.github/workflows: remove old release workflows
mjcheetham a254ae1
release.yml: enable signing, GitHub, NuGet publishing
mjcheetham File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,90 @@ | ||
| <# | ||
| .SYNOPSIS | ||
| Lays out the .NET tool package directory. | ||
|
|
||
| .PARAMETER Configuration | ||
| Build configuration (Debug/Release). Defaults to Debug. | ||
|
|
||
| .PARAMETER Output | ||
| Root output directory for the nupkg layout. If omitted: | ||
| out/shared/DotnetTool/nupkg/<Configuration> | ||
|
|
||
| .EXAMPLE | ||
| pwsh ./layout.ps1 -Configuration Release | ||
|
|
||
| .EXAMPLE | ||
| pwsh ./layout.ps1 -Output C:\temp\tool-layout | ||
|
|
||
| #> | ||
|
|
||
| [CmdletBinding()] | ||
| param( | ||
| [string]$Configuration = "Debug", | ||
| [string]$Output | ||
| ) | ||
|
|
||
| Set-StrictMode -Version Latest | ||
| $ErrorActionPreference = 'Stop' | ||
|
|
||
| function Make-Absolute { | ||
| param([string]$Path) | ||
| if ([string]::IsNullOrWhiteSpace($Path)) { return $null } | ||
| if ([System.IO.Path]::IsPathRooted($Path)) { return $Path } | ||
| return (Join-Path -Path (Get-Location) -ChildPath $Path) | ||
| } | ||
|
|
||
| Write-Host "Starting layout..." -ForegroundColor Cyan | ||
|
|
||
| # Directories | ||
| $ScriptDir = $PSScriptRoot | ||
| $Root = (Resolve-Path (Join-Path $ScriptDir "..\..\..")).Path | ||
| $Src = Join-Path $Root "src" | ||
| $Out = Join-Path $Root "out" | ||
| $DotnetToolRel = "shared/DotnetTool" | ||
| $GcmSrc = Join-Path $Src "shared\Git-Credential-Manager" | ||
| $ProjOut = Join-Path $Out $DotnetToolRel | ||
|
|
||
| $Framework = "net8.0" | ||
|
|
||
| if (-not $Output -or $Output.Trim() -eq "") { | ||
| $Output = Join-Path $ProjOut "nupkg\$Configuration" | ||
| } | ||
|
|
||
| $ImgOut = Join-Path $Output "images" | ||
| $BinOut = Join-Path $Output "tools\$Framework\any" | ||
|
|
||
| # Cleanup previous layout | ||
| if (Test-Path $Output) { | ||
| Write-Host "Cleaning existing output directory '$Output'..." | ||
| Remove-Item -Force -Recurse $Output | ||
| } | ||
|
|
||
| # Recreate directories | ||
| $null = New-Item -ItemType Directory -Path $BinOut -Force | ||
| $null = New-Item -ItemType Directory -Path $ImgOut -Force | ||
|
|
||
| # Determine DOTNET_ROOT if not set | ||
| if (-not $env:DOTNET_ROOT -or $env:DOTNET_ROOT.Trim() -eq "") { | ||
| $dotnetCmd = Get-Command dotnet -ErrorAction Stop | ||
| $env:DOTNET_ROOT = Split-Path -Parent $dotnetCmd.Source | ||
| } | ||
|
|
||
| Write-Host "Publishing core application..." | ||
| & "$env:DOTNET_ROOT/dotnet" publish $GcmSrc ` | ||
| --configuration $Configuration ` | ||
| --framework $Framework ` | ||
| --output (Make-Absolute $BinOut) ` | ||
| -p:UseAppHost=false | ||
|
|
||
| if ($LASTEXITCODE -ne 0) { | ||
| Write-Error "dotnet publish failed with exit code $LASTEXITCODE" | ||
| exit $LASTEXITCODE | ||
| } | ||
|
|
||
| Write-Host "Copying package configuration file..." | ||
| Copy-Item -Path (Join-Path $Src "$DotnetToolRel\DotnetToolSettings.xml") -Destination $BinOut -Force | ||
|
|
||
| Write-Host "Copying images..." | ||
| Copy-Item -Path (Join-Path $Src "$DotnetToolRel\icon.png") -Destination $ImgOut -Force | ||
|
|
||
| Write-Host "Layout complete." -ForegroundColor Green |
This file was deleted.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,95 @@ | ||
| <# | ||
| .SYNOPSIS | ||
| Creates the NuGet package for the .NET tool. | ||
|
|
||
| .PARAMETER Configuration | ||
| Build configuration (Debug/Release). Defaults to Debug. | ||
|
|
||
| .PARAMETER Version | ||
| Package version (required). | ||
|
|
||
| .PARAMETER PackageRoot | ||
| Root of the pre-laid-out package structure (from layout). Defaults to: | ||
| out/shared/DotnetTool/nupkg/<Configuration> | ||
|
|
||
| .PARAMETER Output | ||
| Optional directory for the produced .nupkg/.snupkg. If omitted NuGet chooses. | ||
|
|
||
| .EXAMPLE | ||
| pwsh ./pack.ps1 -Version 2.0.123-beta | ||
|
|
||
| .EXAMPLE | ||
| pwsh ./pack.ps1 -Configuration Release -Version 2.1.0 -Output C:\pkgs | ||
|
|
||
| #> | ||
|
|
||
| [CmdletBinding()] | ||
| param( | ||
| [string]$Configuration = "Debug", | ||
| [Parameter(Mandatory = $true)] | ||
| [string]$Version, | ||
| [string]$PackageRoot, | ||
| [string]$Output | ||
| ) | ||
|
|
||
| Set-StrictMode -Version Latest | ||
| $ErrorActionPreference = 'Stop' | ||
|
|
||
| Write-Host "Starting pack..." -ForegroundColor Cyan | ||
|
|
||
| # Directories | ||
| $ScriptDir = $PSScriptRoot | ||
| $Root = (Resolve-Path (Join-Path $ScriptDir "..\..\..")).Path | ||
| $Src = Join-Path $Root "src" | ||
| $Out = Join-Path $Root "out" | ||
| $DotnetToolRel = "shared\DotnetTool" | ||
| $NuspecFile = Join-Path $Src "$DotnetToolRel\dotnet-tool.nuspec" | ||
|
|
||
| if (-not (Test-Path $NuspecFile)) { | ||
| Write-Error "Could not locate nuspec file at '$NuspecFile'" | ||
| exit 1 | ||
| } | ||
|
|
||
| if (-not $PackageRoot -or $PackageRoot.Trim() -eq "") { | ||
| $PackageRoot = Join-Path $Out "$DotnetToolRel\nupkg\$Configuration" | ||
| } | ||
|
|
||
| if (-not (Test-Path $PackageRoot)) { | ||
| Write-Error "Package root '$PackageRoot' does not exist. Run layout.ps1 first." | ||
| exit 1 | ||
| } | ||
|
|
||
| # Locate nuget | ||
| $nugetCmd = Get-Command nuget -ErrorAction SilentlyContinue | ||
| if (-not $nugetCmd) { | ||
| Write-Error "nuget CLI not found in PATH (install: https://www.nuget.org/downloads)" | ||
| exit 1 | ||
| } | ||
| $nugetExe = $nugetCmd.Source | ||
|
|
||
| Write-Host "Creating .NET tool package..." | ||
|
|
||
| $packArgs = @( | ||
| "pack", "$NuspecFile", | ||
| "-Properties", "Configuration=$Configuration", | ||
| "-Version", $Version, | ||
| "-Symbols", "-SymbolPackageFormat", "snupkg", | ||
| "-BasePath", "$PackageRoot" | ||
| ) | ||
|
|
||
| if ($Output -and $Output.Trim() -ne "") { | ||
| if (-not (Test-Path $Output)) { | ||
| Write-Host "Creating output directory '$Output'..." | ||
| New-Item -ItemType Directory -Force -Path $Output | Out-Null | ||
| } | ||
| $packArgs += @("-OutputDirectory", "$Output") | ||
| } | ||
|
|
||
| & $nugetExe @packArgs | ||
|
|
||
| if ($LASTEXITCODE -ne 0) { | ||
| Write-Error "nuget pack failed with exit code $LASTEXITCODE" | ||
| exit $LASTEXITCODE | ||
| } | ||
|
|
||
| Write-Host ".NET tool pack complete." -ForegroundColor Green |
This file was deleted.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.