Skip to content

Commit

Permalink
dist: add a packaging script
Browse files Browse the repository at this point in the history
  • Loading branch information
DHowett committed Feb 21, 2022
1 parent 8096c12 commit 8d0666f
Showing 1 changed file with 34 additions and 0 deletions.
34 changes: 34 additions & 0 deletions dist.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
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 gave SDK 10.0.22000.0 available.
msbuild .\FrameworkWindowsUtils.sln `
/p:Platform=x64`;Configuration=Release `
/p:OutDir=$PWD\O `
/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" }

0 comments on commit 8d0666f

Please # to comment.