DiscordChatExporter/Deploy/Prepare.ps1
2019-09-26 20:06:35 +03:00

48 lines
No EOL
1.3 KiB
PowerShell

# -- GUI --
$licenseFilePath = "$PSScriptRoot/../License.txt"
$projectDirPath = "$PSScriptRoot/../DiscordChatExporter.Gui"
$publishDirPath = "$PSScriptRoot/bin/build/"
$artifactFilePath = "$PSScriptRoot/bin/DiscordChatExporter.zip"
# Prepare directory
if (Test-Path $publishDirPath) {
Remove-Item $publishDirPath -Recurse -Force
}
New-Item $publishDirPath -ItemType Directory -Force
# Build & publish
dotnet publish $projectDirPath -o $publishDirPath -c Release | Out-Host
$files = @()
$files += Get-Item -Path $licenseFilePath
$files += Get-ChildItem -Path $publishDirPath
# Pack into archive
$files | Compress-Archive -DestinationPath $artifactFilePath -Force
# -- CLI --
$licenseFilePath = "$PSScriptRoot/../License.txt"
$projectDirPath = "$PSScriptRoot/../DiscordChatExporter.Cli"
$publishDirPath = "$PSScriptRoot/bin/build/"
$artifactFilePath = "$PSScriptRoot/bin/DiscordChatExporter.Cli.zip"
# Prepare directory
if (Test-Path $publishDirPath) {
Remove-Item $publishDirPath -Recurse -Force
}
New-Item $publishDirPath -ItemType Directory -Force
# Build & publish
dotnet publish $projectDirPath -o $publishDirPath -c Release | Out-Host
$files = @()
$files += Get-Item -Path $licenseFilePath
$files += Get-ChildItem -Path $publishDirPath
# Pack into archive
$files | Compress-Archive -DestinationPath $artifactFilePath -Force