You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
DiscordChatExporter/Deploy/Prepare.ps1

48 lines
1.3 KiB

# -- 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