-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpublish.ps1
More file actions
27 lines (22 loc) · 1.03 KB
/
publish.ps1
File metadata and controls
27 lines (22 loc) · 1.03 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
$ErrorActionPreference = 'Stop'
# Ensure version number on command line
if([String]::IsNullOrEmpty($Args[0])) { Write-Host "Version is required"; exit 1; }
$version = $Args[0];
if($version.StartsWith('v')) { Write-Host "Version must only be a number"; exit 1; }
# Update csproj version number
# Trim starting v --> v0.9.9 --> 0.9.9 because csproj version must be specific x.y.m.n format
$projPath = get-item "src\CheckAndNotify.csproj"
$csproj = [xml] (get-content $projPath)
$csproj.Project.PropertyGroup.Version = $version
$csproj.Project.PropertyGroup.ContainerImageTags = "$version;latest"
$csProj.Save($projPath)
# Ensure git committed (we will tag and push on release)
# Do after modifying csproj version to catch that update
#$changes = $(git status --porcelain)
#if(![String]::IsNullOrEmpty($changes)) { Write-Host "Uncommitted changes in git"; exit 1; }
# Invoke the linux build - cwd is transformed by wsl.exe and passes through
wsl -- ./publish.sh $version
# Version it
#git tag $version
#git push --tags
#Write-Host "Run git push --tags"