-
Notifications
You must be signed in to change notification settings - Fork 2
/
create-nuget-debug.ps1
20 lines (16 loc) · 890 Bytes
/
create-nuget-debug.ps1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
# Git command used for getting latest commit
$gitCmdName = "git"
$gitCmdParameter = "rev-parse HEAD"
$currentDate = Get-Date
# Write-Host $currentDate.ToUniversalTime()
$latestGitCommitHashFull = "Git is not installed"
$latestGitCommitHashShort = "Git is not installed"
if (Get-Command $gitCmdName -errorAction SilentlyContinue)
{
$latestGitCommitHashFull = &git rev-parse HEAD
$latestGitCommitHashShort = &git rev-parse --short HEAD
# Write-Host "$gitCmdName exists"
}
Write-Host $latestGitCommitHashFull $latestGitCommitHashShort
$finalCommand = "dotnet pack" + " " + "--configuration Debug" + " " + "--include-source" + " " + "--include-symbols" + " " + "/p:InformationalVersion=""" + $currentDate.ToUniversalTime().ToString("yyyy-MM-dd HH.mm.ss") + " " + $latestGitCommitHashFull + """" + " " + "--version-suffix" + " git-" + $latestGitCommitHashShort
Write-Host $finalCommand