Skip to content

Commit 86bf331

Browse files
authored
Add Azure Pipelines build YAML (#2054)
Add a release pipeline for Windows using Azure Pipelines. This pipeline is currently incomplete; a stub so we can link up Azure Pipelines to this YAML during development. This pipeline uses internal Microsoft 1ES templates.
2 parents 9d767be + 09d797e commit 86bf331

File tree

2 files changed

+57
-23
lines changed

2 files changed

+57
-23
lines changed

.azure-pipelines/release.yml

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
name: Release-$(Date:yyyyMMdd)$(Rev:.r)
2+
trigger: none
3+
pr: none
4+
5+
resources:
6+
repositories:
7+
- repository: 1ESPipelines
8+
type: git
9+
name: 1ESPipelineTemplates/1ESPipelineTemplates
10+
ref: refs/tags/release
11+
12+
parameters:
13+
- name: 'esrp'
14+
type: boolean
15+
default: false
16+
displayName: 'Enable ESRP code signing'
17+
18+
extends:
19+
template: v1/1ES.Official.PipelineTemplate.yml@1ESPipelines
20+
parameters:
21+
stages:
22+
- stage: windows
23+
displayName: 'Windows'
24+
jobs:
25+
- job: win_x86_build
26+
displayName: 'Windows Build and Sign (x86)'
27+
pool:
28+
name: GitClient-1ESHostedPool-intel-pc
29+
image: win-x86_64-ado1es
30+
os: windows
31+
steps:
32+
- checkout: self

src/windows/Installer.Windows/layout.ps1

Lines changed: 25 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,22 @@
11
# Inputs
2-
param ([Parameter(Mandatory)] $CONFIGURATION, [Parameter(Mandatory)] $OUTPUT, $SYMBOLOUTPUT)
2+
param ([Parameter(Mandatory)] $Configuration, [Parameter(Mandatory)] $Output, $SymbolOutput)
33

4-
Write-Output "Output: $OUTPUT"
4+
Write-Output "Output: $Output"
55

66
# Directories
7-
$THISDIR = $pwd.path
8-
$ROOT = (Get-Item $THISDIR).parent.parent.parent.FullName
9-
$SRC = "$ROOT/src"
10-
$GCM_SRC = "$SRC/shared/Git-Credential-Manager"
7+
$THISDIR = $PSScriptRoot
8+
$ROOT = (Get-Item $THISDIR).Parent.Parent.Parent.FullName
9+
$SRC = "$ROOT\src"
10+
$GCM_SRC = "$SRC\shared\Git-Credential-Manager"
1111

1212
# Perform pre-execution checks
13-
$PAYLOAD = "$OUTPUT"
14-
if ($SYMBOLOUTPUT)
13+
$PAYLOAD = "$Output"
14+
if ($SymbolOutput)
15+
{
16+
$SYMBOLS = "$SymbolOutput"
17+
}
18+
else
1519
{
16-
$SYMBOLS = "$SYMBOLOUTPUT"
17-
} else {
1820
$SYMBOLS = "$PAYLOAD.sym"
1921
}
2022

@@ -32,37 +34,37 @@ if (Test-Path -Path $SYMBOLS)
3234
}
3335

3436
# Ensure payload and symbol directories exist
35-
mkdir -p "$PAYLOAD","$SYMBOLS"
37+
mkdir -p "$PAYLOAD","$SYMBOLS" | Out-Null
3638

3739
# Publish core application executables
3840
Write-Output "Publishing core application..."
3941
dotnet publish "$GCM_SRC" `
4042
--framework net472 `
41-
--configuration "$CONFIGURATION" `
43+
--configuration "$Configuration" `
4244
--runtime win-x86 `
4345
--output "$PAYLOAD"
4446

4547
# Delete libraries that are not needed for Windows but find their way
4648
# into the publish output.
47-
Remove-Item -Path "$PAYLOAD/*.dylib" -Force
49+
Remove-Item -Path "$PAYLOAD/*.dylib" -Force -ErrorAction Ignore
4850

4951
# Delete extraneous files that get included for other architectures
5052
# We only care about x86 as the core GCM executable is only targeting x86
51-
Remove-Item -Path "$PAYLOAD/arm/" -Recurse -Force
52-
Remove-Item -Path "$PAYLOAD/arm64/" -Recurse -Force
53-
Remove-Item -Path "$PAYLOAD/x64/" -Recurse -Force
54-
Remove-Item -Path "$PAYLOAD/musl-x64/" -Recurse -Force
55-
Remove-Item -Path "$PAYLOAD/runtimes/win-arm64/" -Recurse -Force
56-
Remove-Item -Path "$PAYLOAD/runtimes/win-x64/" -Recurse -Force
53+
Remove-Item -Path "$PAYLOAD/arm/" -Recurse -Force -ErrorAction Ignore
54+
Remove-Item -Path "$PAYLOAD/arm64/" -Recurse -Force -ErrorAction Ignore
55+
Remove-Item -Path "$PAYLOAD/x64/" -Recurse -Force -ErrorAction Ignore
56+
Remove-Item -Path "$PAYLOAD/musl-x64/" -Recurse -Force -ErrorAction Ignore
57+
Remove-Item -Path "$PAYLOAD/runtimes/win-arm64/" -Recurse -Force -ErrorAction Ignore
58+
Remove-Item -Path "$PAYLOAD/runtimes/win-x64/" -Recurse -Force -ErrorAction Ignore
5759

5860
# The Avalonia and MSAL binaries in these directories are already included in
5961
# the $PAYLOAD directory directly, so we can delete these extra copies.
60-
Remove-Item -Path "$PAYLOAD/x86/libSkiaSharp.dll" -Recurse -Force
61-
Remove-Item -Path "$PAYLOAD/x86/libHarfBuzzSharp.dll" -Recurse -Force
62-
Remove-Item -Path "$PAYLOAD/runtimes/win-x86/native/msalruntime_x86.dll" -Recurse -Force
62+
Remove-Item -Path "$PAYLOAD/x86/libSkiaSharp.dll" -Recurse -Force -ErrorAction Ignore
63+
Remove-Item -Path "$PAYLOAD/x86/libHarfBuzzSharp.dll" -Recurse -Force -ErrorAction Ignore
64+
Remove-Item -Path "$PAYLOAD/runtimes/win-x86/native/msalruntime_x86.dll" -Recurse -Force -ErrorAction Ignore
6365

6466
# Delete localized resource assemblies - we don't localize the core GCM assembly anyway
65-
Get-ChildItem "$PAYLOAD" -Recurse -Include "*.resources.dll" | Remove-Item -Force
67+
Get-ChildItem "$PAYLOAD" -Recurse -Include "*.resources.dll" | Remove-Item -Force -ErrorAction Ignore
6668

6769
# Delete any empty directories
6870
Get-ChildItem "$PAYLOAD" -Recurse -Directory `

0 commit comments

Comments
 (0)