Add deploy via chocolatey

pull/172/head
Alexey Golub 6 years ago
parent d13d04e75b
commit 640b1f5866

@ -0,0 +1,25 @@
<?xml version="1.0" encoding="utf-8"?>
<package xmlns="http://schemas.microsoft.com/packaging/2015/06/nuspec.xsd">
<metadata>
<id>discordchatexporter</id>
<title>DiscordChatExporter</title>
<version>2.11</version>
<owners>Tyrrrz</owners>
<authors>Tyrrrz</authors>
<copyright>Copyright (C) Alexey Golub</copyright>
<summary>Exports Discord chat logs to a file</summary>
<description>DiscordChatExporter can be used to export message history from a Discord channel to a file. It works for both direct message chats and guild chats, supports markdown, message grouping, and attachments. The tool also lets you select from/to dates to limit the exported messages. There are options to configure the output, such as date format, color theme, message grouping limit, etc.</description>
<tags>discordchatexporter discord export chat logs archive gui</tags>
<projectSourceUrl>https://github.com/Tyrrrz/DiscordChatExporter</projectSourceUrl>
<packageSourceUrl>https://github.com/Tyrrrz/DiscordChatExporter</packageSourceUrl>
<projectUrl>http://tyrrrz.me/Projects/DiscordChatExporter</projectUrl>
<releaseNotes>https://github.com/Tyrrrz/DiscordChatExporter/blob/master/Changelog.md</releaseNotes>
<iconUrl>https://raw.githubusercontent.com/Tyrrrz/DiscordChatExporter/master/favicon.png</iconUrl>
<licenseUrl>https://raw.githubusercontent.com/Tyrrrz/DiscordChatExporter/master/License.txt</licenseUrl>
<requireLicenseAcceptance>true</requireLicenseAcceptance>
<bugTrackerUrl>https://github.com/Tyrrrz/DiscordChatExporter/issues</bugTrackerUrl>
</metadata>
<files>
<file src="tools\**" target="tools" />
</files>
</package>

@ -0,0 +1,19 @@
$ErrorActionPreference = 'Stop';
# --- GUI ---
$packageArgs = @{
packageName = $env:ChocolateyPackageName
unzipLocation = "$(Split-Path -parent $MyInvocation.MyCommand.Definition)"
url = 'https://github.com/Tyrrrz/DiscordChatExporter/releases/download/2.11/DiscordChatExporter.zip'
}
Install-ChocolateyZipPackage @packageArgs
# --- CLI ---
$packageArgs = @{
packageName = $env:ChocolateyPackageName
unzipLocation = "$(Split-Path -parent $MyInvocation.MyCommand.Definition)"
url = 'https://github.com/Tyrrrz/DiscordChatExporter/releases/download/2.11/DiscordChatExporter.CLI.zip'
}
Install-ChocolateyZipPackage @packageArgs

@ -1,13 +1,27 @@
New-Item "$PSScriptRoot\bin" -ItemType Directory -Force
# --- PORTABLE / GUI ---
# GUI
# Get files
$files = @()
$files += Get-Item -Path "$PSScriptRoot\..\License.txt"
$files += Get-ChildItem -Path "$PSScriptRoot\..\DiscordChatExporter.Gui\bin\Release\*" -Include "*.exe", "*.dll", "*.config"
$files | Compress-Archive -DestinationPath "$PSScriptRoot\bin\DiscordChatExporter.zip" -Force
# CLI
# Pack into archive
New-Item "$PSScriptRoot\Portable\GUI\bin" -ItemType Directory -Force
$files | Compress-Archive -DestinationPath "$PSScriptRoot\Portable\GUI\bin\DiscordChatExporter.zip" -Force
# --- PORTABLE / CLI ---
# Get files
$files = @()
$files += Get-Item -Path "$PSScriptRoot\..\License.txt"
$files += Get-ChildItem -Path "$PSScriptRoot\..\DiscordChatExporter.Cli\bin\Release\net46\*" -Include "*.exe", "*.dll", "*.config"
$files | Compress-Archive -DestinationPath "$PSScriptRoot\bin\DiscordChatExporter.CLI.zip" -Force
# Pack into archive
New-Item "$PSScriptRoot\Portable\CLI\bin" -ItemType Directory -Force
$files | Compress-Archive -DestinationPath "$PSScriptRoot\Portable\CLI\bin\DiscordChatExporter.CLI.zip" -Force
# --- CHOCOLATEY ---
# Create package
New-Item "$PSScriptRoot\Choco\bin\" -ItemType Directory -Force
choco pack $PSScriptRoot\Choco\discordchatexporter.nuspec --out $PSScriptRoot\Choco\bin\

@ -10,3 +10,5 @@ function Replace-TextInFile {
Replace-TextInFile "$PSScriptRoot\DiscordChatExporter.Cli\DiscordChatExporter.Cli.csproj" '(?<=<Version>)(.*?)(?=</Version>)' $newVersion
Replace-TextInFile "$PSScriptRoot\DiscordChatExporter.Gui\Properties\AssemblyInfo.cs" '(?<=Assembly.*?Version\(")(.*?)(?="\)\])' $newVersion
Replace-TextInFile "$PSScriptRoot\Deploy\Choco\discordchatexporter.nuspec" '(?<=<version>)(.*?)(?=</version>)' $newVersion
Replace-TextInFile "$PSScriptRoot\Deploy\Choco\tools\chocolateyinstall.ps1" '(?<=download/)(.*?)(?=/)' $newVersion

@ -13,17 +13,28 @@ after_build:
- ps: Deploy\Prepare.ps1
artifacts:
- path: Deploy\bin\DiscordChatExporter.zip
- path: Deploy\Portable\GUI\bin\DiscordChatExporter.zip
name: DiscordChatExporter.zip
- path: Deploy\bin\DiscordChatExporter.Cli.zip
name: DiscordChatExporter.Cli.zip
- path: Deploy\Portable\CLI\bin\DiscordChatExporter.CLI.zip
name: DiscordChatExporter.CLI.zip
- path: Deploy\Choco\bin\DiscordChatExporter*.nupkg
name: DiscordChatExporter-Choco.nupkg
deploy:
- provider: GitHub
auth_token:
secure: sjQHWRw29AMiVMn3MtidtWnAzAf1mJ+mkJ/7h1B9TIAHhkFrqwMK7LtXV+uNJ9AO
artifact: DiscordChatExporter.zip,DiscordChatExporter.Cli.zip
artifact: DiscordChatExporter.zip,DiscordChatExporter.CLI.zip
description: '[Changelog](https://github.com/Tyrrrz/DiscordChatExporter/blob/master/Changelog.md)'
on:
branch: master
appveyor_repo_tag: true
- provider: NuGet
server: https://push.chocolatey.org/
api_key:
secure: aQVQ50i8GcwxMXTHf2ck5PijnOeVZY8Z9MEROQTvT49/7/az9w8ru8NCyEsV6H5I
artifact: DiscordChatExporter-Choco.nupkg
skip_symbols: true
on:
branch: master
appveyor_repo_tag: true
Loading…
Cancel
Save