-
Notifications
You must be signed in to change notification settings - Fork 1
/
Publish-Task-PhotoPickup.ps1
28 lines (15 loc) · 1.22 KB
/
Publish-Task-PhotoPickup.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
$ErrorActionPreference = "Stop"
.\Tools-CopyReadmeToProjectSpecificReadme.ps1
$PublishVersion = get-date -f yyyy-MM-dd-HH-mm
$GitCommit = & git rev-parse --short HEAD
dotnet clean .\PointlessWaymarks.sln -property:Configuration=Release -property:Platform=x64 -verbosity:minimal
dotnet restore .\PointlessWaymarks.sln -r win-x64 -verbosity:minimal
$vsWhere = "{0}\Microsoft Visual Studio\Installer\vswhere.exe" -f ${env:ProgramFiles(x86)}
$msBuild = & $vsWhere -latest -prerelease -requires Microsoft.Component.MSBuild -find MSBuild\**\Bin\MSBuild.exe
& $msBuild .\PointlessWaymarks.sln -property:Configuration=Release -property:Platform=x64 -verbosity:minimal
if ($lastexitcode -ne 0) { throw ("Exec: " + $errorMessage) }
$publishPath = "M:\PointlessWaymarksPublications\PointlessWaymarks.Task.PhotoPickup"
if(!(test-path -PathType container $publishPath)) { New-Item -ItemType Directory -Path $publishPath }
Remove-Item -Path $publishPath\* -Recurse
& $msBuild .\PointlessWaymarks.Task.PhotoPickup\PointlessWaymarks.Task.PhotoPickup.csproj -t:publish -p:PublishProfile=.\PointlessWaymarks.Task.PhotoPickup\Properties\PublishProfile\FolderProfile.pubxml -verbosity:minimal
if ($lastexitcode -ne 0) { throw ("Exec: " + $errorMessage) }