-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathpublish.ps1
17 lines (14 loc) · 836 Bytes
/
publish.ps1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
param (
[string]$dir = "$pwd\ChocolateStoreCore"
)
$projectFile = "$dir\ChocolateStoreCore.csproj"
$dirRelease = "$dir\..\release"
$dirReleaseAssets = "$dirRelease\ChocolateStoreCore"
$dirReleaseAssetsStore = "$dirReleaseAssets\store"
$zip = 'ChocolateStoreCore.zip'
If (Test-Path $dirRelease) { Remove-Item $dirRelease -Recurse -Force }
dotnet publish $projectFile -c Release -r win-x64 --self-contained false /p:PublishSingleFile=true /p:PublishTrimmed=false /p:PublishDir="$dirReleaseAssets"
New-Item -ItemType Directory -Path $dirReleaseAssetsStore
New-Item -Path (Join-Path -Path $dirReleaseAssetsStore -ChildPath 'dummy.txt') -ItemType File
Compress-Archive -Path "$dirReleaseAssets\*" -DestinationPath (Join-Path $dirRelease $zip)
If (Test-Path $dirReleaseAssets) { Remove-Item $dirReleaseAssets -Recurse -Force }