forked from FlaUI/FlaUInspect
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCreateArtefacts.ps1
44 lines (35 loc) · 1.33 KB
/
CreateArtefacts.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
36
37
38
39
40
41
42
43
44
$artefactDir = "Artefacts"
$tempDir = "Temp"
$version = "1.2.0"
$rootPath = "."
function Main {
if (Test-Path $artefactDir) {
rd $artefactDir -Recurse | Out-Null
}
md -Name $artefactDir | Out-Null
if (Test-Path $tempDir) {
rd $tempDir -Recurse | Out-Null
}
md -Name $tempDir | Out-Null
# FlaUInspect
$inspectDir = Join-Path $tempDir "FlaUInspect-$version"
Copy-Item -Path $rootPath\src\FlaUInspect\bin -Destination $inspectDir -Recurse
Get-ChildItem $inspectDir -Include *.pdb,*.xml,*.vshost.*,*RANDOM_SEED* -Recurse | Remove-Item
Deploy-License $inspectDir
# Create Zips
[Reflection.Assembly]::LoadWithPartialName("System.IO.Compression.FileSystem") | Out-Null
$compression = [System.IO.Compression.CompressionLevel]::Optimal
$includeBaseDirectory = $false
[System.IO.Compression.ZipFile]::CreateFromDirectory($inspectDir, (Join-Path $artefactDir "FlaUInspect-$version.zip"), $compression, $includeBaseDirectory)
Create-Packages
# Cleanup
rd $tempDir -Recurse
}
function Deploy-License($dest) {
Copy-Item -Path $rootPath\CHANGELOG.md -Destination $dest
Copy-Item -Path $rootPath\LICENSE.txt -Destination $dest
}
function Create-Packages() {
choco pack "$rootPath\nuspec\FlaUInspect.nuspec" -OutputDirectory $artefactDir --version $version
}
Main