-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.ps1
34 lines (32 loc) · 1.09 KB
/
build.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
$target = "D:\tools\chocolatey.server\App_Data\Packages"
$choco = "choco"
$gitrepo="D:\gitrepos\chocopackages"
$tags = @()
$tags=git for-each-ref --sort=taggerdate --format="%(refname)" |Select-string -Pattern "^refs/tags"
$total=$tags.count
$i=0
$tag=''
foreach ($tag in $tags) {
[string]$cleantag=$tag
#$cleantag
$cleantag = $cleantag.Substring($cleantag.LastIndexOf("/") + 1)
write-output "$cleantag"
git checkout -f $tag
# handle preleases
if (($cleantag.substring($cleantag.LastIndexOf("-"))).contains("-alpha")) {
$packagename = $foo.substring(0,$foo.LastIndexOf("-",$foo.LastIndexOf("-")-1))
}
else {
$packagename = $cleantag.substring(0,$cleantag.LastIndexOf("-"))
}
$packagepath=join-path $gitrepo $packagename
write-output "packagepath: $packagepath"
set-location $packagepath
write-output "packagename: $packagename.nuspec"
$Arguments = "pack .\$packagename.nuspec --outputdirectory $target"
start-process choco $arguments -NoNewWindow -Wait
set-location $gitrepo
$i++
write-output "processed package $package $i of $total"
}
git checkout -f master