-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathdist.ps1
35 lines (29 loc) · 1.06 KB
/
dist.ps1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
Param(
[string]$Version = "0.0.1",
[string]$Cert = "cb9a86724771546a51851651d18e811a72f6e133"
)
$ErrorActionPreference='Stop'
rm -r -force O -EA:Ignore
### This must be run from the EWDK environment.
### It expects that you have SDK 10.0.22621.0 available.
msbuild .\FrameworkWindowsUtils.sln `
/p:Platform=x64`;Configuration=Release `
/p:OutDir=$PWD\O\ `
/p:Reproducible=true `
/p:TestCertificate=$Cert `
/m
If ($LASTEXITCODE -Ne 0) { throw "Failed to Build" }
$BaseName="CrosEC-${Version}-$(git describe --always --abbrev)"
$Archive="${BaseName}.zip"
$DistDir="_dist\$BaseName"
rm -r -force _dist -EA:Ignore
mkdir $DistDir | out-null
mkdir "$DistDir\debug" | out-null
cp O\*.exe $DistDir
cp O\*.pdb "$DistDir\debug"
cp O\CrosEC\* $DistDir
signtool sign /sha1 $Cert /fd SHA256 /t http://timestamp.digicert.com (Get-Item $DistDir\*.exe | Select -Expand FullName)
If ($LASTEXITCODE -Ne 0) { throw "Failed to Sign" }
rm -force $Archive -EA:Ignore
tar -c --format zip --strip-components=1 -f $Archive _dist
If ($LASTEXITCODE -Ne 0) { throw "Failed to Archive" }