-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathprepare-version.ps1
More file actions
31 lines (26 loc) · 1012 Bytes
/
prepare-version.ps1
File metadata and controls
31 lines (26 loc) · 1012 Bytes
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
param (
[string]$commitish = "master"
)
############################
# Update Assembly version
############################
. ./Version.ps1
foreach ($file in $assemblyFiles) {
(Get-Content $file.PSPath) | ForEach-Object {
if ($_ -match $pattern) {
# We have found the matching line
# Edit the version number and put back.
write-host "Setting AssemblyInfo version to $newAssemblyVersion"
'[assembly: AssemblyVersion("{0}")]' -f $newAssemblyVersion
}
else {
# Output line as is
$_
}
} | Set-Content $file.PSPath
}
##########################################################
# Write the POST body for the GitHub API Release-command
##########################################################
write-host Creating GitHub API release-request.json
'{ "tag_name": "v' + $newVersion + '", "target_commitish": "' + $commitish + '", "name": "v' + $newVersion + '", "body": "Version ' + $newVersion + '", "draft": false, "prerelease": false }' | Out-File -FilePath "release-request.json"