-
Notifications
You must be signed in to change notification settings - Fork 20
Expand file tree
/
Copy pathpack_artifacts.ps1
More file actions
98 lines (80 loc) · 2.77 KB
/
Copy pathpack_artifacts.ps1
File metadata and controls
98 lines (80 loc) · 2.77 KB
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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
param([String]$zipName = "miritore.zip")
function Test-TagRelease()
{
[String]$repoTag = $env:APPVEYOR_REPO_TAG
[Boolean]$r = $false
if ($null -eq $repoTag)
{
$r = $false
}
else
{
[Boolean]$r = $false
# Be sure to discard the return value otherwise it appears in the result and turns the result
# to and object array.
[Boolean]::TryParse($repoTag, [ref]$r) | Out-Null
}
return $r
}
function Add-ProgramFiles()
{
[String]$configuration = $env:CONFIGURATION
[String]$basePath = $env:APPVEYOR_BUILD_FOLDER
[String[]]$subPaths = @(
[String]::Format("src/AcbPack/bin/{0}", $configuration),
[String]::Format("src/HcaDec/bin/{0}", $configuration),
[String]::Format("src/MillionDance/bin/x86/{0}", $configuration), # temporarily pinned to x86 because of AssetStudioUtilities
[String]::Format("src/MillionDanceView/bin/x86/{0}", $configuration), # temporarily pinned to x86 because of AssetStudioUtilities
[String]::Format("src/MiriTore.Common/bin/{0}", $configuration),
[String]::Format("src/MiriTore.Logging/bin/{0}", $configuration),
[String]::Format("src/MltdInfoViewer/bin/{0}", $configuration),
[String]::Format("src/ExtractAcb/bin/{0}", $configuration),
[String]::Format("src/TDFacial/bin/{0}", $configuration), # remember to include facial_expr.json
[String]::Format("src/ManifestTools/bin/{0}", $configuration),
[String]::Empty
);
foreach ($subPath in $subPaths)
{
if ( [String]::IsNullOrEmpty($subPath))
{
continue;
}
[String]$fullDirPath = [System.IO.Path]::Combine($basePath, $subPath);
[String]$xmlFilesPattern = [System.IO.Path]::Combine($fullDirPath, "*.xml")
Remove-Item $xmlFilesPattern
[String]$allFilesPattern = [System.IO.Path]::Combine($fullDirPath, "*")
& 7z a $zipName -r $allFilesPattern
}
}
function Add-MiscFiles()
{
[String]$buildDir = $env:APPVEYOR_BUILD_FOLDER;
[String[]]$subPaths = @(
"./README.html",
"./version.txt",
[String]::Empty
);
foreach ($subPath in $subPaths)
{
if ( [String]::IsNullOrEmpty($subPath))
{
continue;
}
[String]$fullPath = [System.IO.Path]::Combine($buildDir, $subPath);
& 7z a miritore.zip $fullPath
}
}
Add-ProgramFiles
Add-MiscFiles
[Boolean]$isTagRelease = Test-TagRelease
[String]$tagRelComp = if ($isTagRelease)
{
"-rel"
}
else
{
[String]::Empty
}
Push-AppveyorArtifact $zipName -FileName "miritore-appveyor${tagRelComp}-v${env:APPVEYOR_BUILD_VERSION}${env:RELEASE_SUFFIX}.zip" -DeploymentName "Versioned"
# Latest artifact (half-permanent link)
Push-AppveyorArtifact $zipName -FileName "miritore-appveyor-latest.zip" -DeploymentName "Latest"