Skip to content

Commit 5e8c084

Browse files
committed
set up chocolatey
1 parent 67425eb commit 5e8c084

9 files changed

Lines changed: 71 additions & 15 deletions

File tree

ColorCat.sln

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11

22
Microsoft Visual Studio Solution File, Format Version 12.00
33
# Visual Studio 14
4-
VisualStudioVersion = 14.0.24720.0
4+
VisualStudioVersion = 14.0.23107.0
55
MinimumVisualStudioVersion = 10.0.40219.1
66
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ColorCat", "ColorCat\ColorCat.csproj", "{022A0482-5B90-426A-862C-8891C6D5DB8C}"
77
EndProject
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
$packageName = 'ColorCat.portable' # arbitrary name for the package, used in messages
2+
$url ="https://github.com/MasterDevs/ColorCat/releases/download/v0.0.2/bin.zip"
3+
4+
try
5+
{
6+
$installDir = Join-Path $env:AllUsersProfile "$packageName"
7+
Write-Host "Adding `'$installDir`' to the path and the current shell path"
8+
Install-ChocolateyPath "$installDir"
9+
$env:Path = "$($env:Path);$installDir"
10+
11+
Install-ChocolateyZipPackage "$packageName" "$url" "$installDir"
12+
}
13+
catch
14+
{
15+
Write-ChocolateyFailure "$packageName" "$($_.Exception.Message)"
16+
throw
17+
}
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
$packageName = 'ColorCat.portable' # arbitrary name for the package, used in messages
2+
$zipName = "bin.zip"
3+
4+
try
5+
{
6+
$installDir = Join-Path $env:AllUsersProfile "$packageName"
7+
Uninstall-ChocolateyZipPackage "$packageName" "$zipName"
8+
Remove-Item -Recurse -Force "$installDir"
9+
}
10+
catch
11+
{
12+
Write-ChocolateyFailure "$packageName" "$($_.Exception.Message)"
13+
throw
14+
}

ColorCat/Chocolatey/install.bat

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
cinst ColorCat.portable -yf -s %CD%

ColorCat/Chocolatey/pack.bat

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
cpack --version 0.0.1 --force

ColorCat/Chocolatey/package.nuspec

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<!-- Do not remove this test for UTF-8: if �O� doesn�t appear as greek uppercase omega letter enclosed in quotation marks, you should use an editor that supports UTF-8, not this one. -->
3+
<package xmlns="http://schemas.microsoft.com/packaging/2010/07/nuspec.xsd">
4+
<metadata>
5+
<id>ColorCat.portable</id>
6+
<title>ColorCat (Portable)</title>
7+
<version>0.0.1</version>
8+
<authors>MasterDevs</authors>
9+
<owners>MasterDevs</owners>
10+
<summary>Add a little color to your console</summary>
11+
<description>Read from standard input and output colored text to the console</description>
12+
<tags>console color cat colorize command-line</tags>
13+
<copyright></copyright>
14+
<requireLicenseAcceptance>false</requireLicenseAcceptance>
15+
<releaseNotes></releaseNotes>
16+
<licenseUrl> https://github.com/MasterDevs/ColorCat/blob/master/LICENSE </licenseUrl>
17+
<projectUrl> https://github.com/MasterDevs/ColorCat </projectUrl>
18+
</metadata>
19+
<files>
20+
<file src="tools\**" target="tools" />
21+
</files>
22+
</package>

ColorCat/Chocolatey/uninstall.bat

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
cuninst -y ColorCat.portable

ColorCat/ColorCat.csproj

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,12 @@
5151
<None Include="App.config">
5252
<SubType>Designer</SubType>
5353
</None>
54+
<None Include="Chocolatey\install.bat" />
55+
<None Include="Chocolatey\pack.bat" />
56+
<None Include="Chocolatey\package.nuspec" />
57+
<None Include="Chocolatey\Tools\chocolateyInstall.ps1" />
58+
<None Include="Chocolatey\Tools\chocolateyUninstall.ps1" />
59+
<None Include="Chocolatey\uninstall.bat" />
5460
</ItemGroup>
5561
<ItemGroup>
5662
<Content Include="SampleLog.txt">

appveyor.yml

Lines changed: 8 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,20 @@
1-
# Great reference: http://www.appveyor.com/docs/appveyor-yml
2-
31
version: 1.0.{build}
42
skip_tags: false
53
configuration: Release
64
init:
75
- ps: >-
86
$parsedReleaseBuildVersion = $env:APPVEYOR_REPO_TAG_NAME -Match "(\d+.\d+.\d+(.\d+)?)"
9-
7+
108
If($env:appveyor_repo_tag -AND $parsedReleaseBuildVersion) {
119
$env:BuildVersion = $matches[0]
1210
$env:IsGithubRelease = $TRUE
13-
}
14-
else {
11+
} else {
1512
$env:BuildVersion = $env:appveyor_build_version
1613
$env:IsGithubRelease = ""
1714
}
18-
15+
1916
Write-Host "Build Version: " $env:BuildVersion
20-
17+
2118
Write-Host "appveyor_build_version Variable: " $env:appveyor_build_version
2219
assembly_info:
2320
patch: true
@@ -30,19 +27,16 @@ nuget:
3027
project_feed: true
3128
before_build:
3229
- nuget restore ColorCat.sln
33-
3430
build:
3531
project: ColorCat.sln
3632
publish_nuget: true
3733
publish_nuget_symbols: true
3834
verbosity: minimal
39-
40-
# Skip chocolatey for now
41-
# after_build:
42-
# - cpack ColorCat\Chocolatey\package.nuspec --version %BuildVersion%
43-
35+
after_build:
36+
- cpack ColorCat\Chocolatey\package.nuspec --version %BuildVersion%
4437
artifacts:
45-
- path: ColorCat\bin\$(configuration)\ColorCat.exe
38+
- path: ColorCat\bin\$(configuration)
39+
name: bin
4640
- path: '*.nupkg'
4741
name: package
4842
deploy:

0 commit comments

Comments
 (0)