Skip to content
This repository was archived by the owner on Sep 20, 2022. It is now read-only.

Commit a2a26ab

Browse files
author
Jake Ginnivan
committed
Added chocolatey build
1 parent c6acc9e commit a2a26ab

File tree

3 files changed

+85
-6
lines changed

3 files changed

+85
-6
lines changed

Chocolatey/GitReleaseNotes.nuspec

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<package xmlns="http://schemas.microsoft.com/packaging/2010/07/nuspec.xsd">
3+
<metadata>
4+
<id>GitReleaseNotes</id>
5+
<title>GitReleaseNotes</title>
6+
<version>__version__</version>
7+
<authors>Jake Ginnivan</authors>
8+
<owners>Jake Ginnivan</owners>
9+
<summary>GitReleaseNotes</summary>
10+
<description>GitReleaseNotes generates release notes for any Git repository</description>
11+
<projectUrl>https://github.com/JakeGinnivan/GitReleaseNotes</projectUrl>
12+
<tags>GitReleaseNotes, Release Notes, Jira, GitHub, YouTrack, Git</tags>
13+
<licenseUrl>https://github.com/JakeGinnivan/GitReleaseNotes/blob/master/LICENSE</licenseUrl>
14+
<requireLicenseAcceptance>false</requireLicenseAcceptance>
15+
<releaseNotes>https://github.com/JakeGinnivan/GitReleaseNotes/releases</releaseNotes>
16+
</metadata>
17+
<files>
18+
<file src="tools\**" target="tools" />
19+
</files>
20+
</package>
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
$packageName = 'GitReleaseNotes'
2+
$version = '__version__'
3+
$url = 'https://github.com/JakeGinnivan/GitReleaseNotes/releases/download/$version/GitReleaseNotes.$version.zip'
4+
$validExitCodes = @(0)
5+
6+
Install-ChocolateyZipPackage "$packageName" "$url" "$(Split-Path -parent $MyInvocation.MyCommand.Definition)"

GitReleaseNotes.proj

Lines changed: 59 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<?xml version="1.0" encoding="utf-8"?>
2-
<Project DefaultTargets="Cleanup;Build;Package" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
2+
<Project DefaultTargets="Cleanup;Build;Package" ToolsVersion="12" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
33
<PropertyGroup>
44
<Root>$(MSBuildProjectDirectory)\</Root>
55
<BuildPlatform Condition="$(BuildPlatform) == ''">Any CPU</BuildPlatform>
@@ -38,15 +38,68 @@
3838
<xunit Assembly="$(Root)src\GitReleaseNotes.AcceptanceTests\bin\$(Configuration)\GitReleaseNotes.AcceptanceTests.dll" ShadowCopy="False" />
3939
</Target>
4040

41+
<UsingTask TaskName="ReplaceFileText" TaskFactory="CodeTaskFactory" AssemblyFile="$(MSBuildToolsPath)\Microsoft.Build.Tasks.v$(MSBuildToolsVersion).dll">
42+
<ParameterGroup>
43+
<InputFilename ParameterType="System.String" Required="true" />
44+
<OutputFilename ParameterType="System.String" Required="true" />
45+
<MatchExpression ParameterType="System.String" Required="true" />
46+
<ReplacementText ParameterType="System.String" Required="true" />
47+
</ParameterGroup>
48+
<Task>
49+
<Reference Include="System.Core" />
50+
<Using Namespace="System" />
51+
<Using Namespace="System.IO" />
52+
<Using Namespace="System.Text.RegularExpressions" />
53+
<Code Type="Fragment" Language="cs">
54+
<![CDATA[
55+
File.WriteAllText(
56+
OutputFilename,
57+
Regex.Replace(File.ReadAllText(InputFilename), MatchExpression, ReplacementText)
58+
);
59+
]]>
60+
</Code>
61+
</Task>
62+
</UsingTask>
63+
4164
<Target Name="Package" DependsOnTargets="Test">
4265
<ItemGroup>
43-
<BuildOutput Include="$(Root)src\GitHubFlowVersion\bin\$(Configuration)\**\*.*"/>
66+
<BuildOutput Include="$(BuildOutputPath)\**\*.*" Exclude="$(BuildOutputPath)\**\*.vshost.exe"/>
4467
</ItemGroup>
4568

46-
<Copy SourceFiles="@(BuildOutput)"
47-
DestinationFiles="@(BuildOutput->'$(DropPath)%(RecursiveDir)%(Filename)%(Extension)')" />
48-
4969
<MakeDir Directories="$(DropPath)" />
50-
<Exec Command="$(Root)src\.NuGet\NuGet.exe pack $(Root)GitReleaseNotes.nuspec -BasePath $(BuildOutputPath) -OutputDirectory $(DropPath) -Properties Version=$(GitHubFlowVersion_SemVer) -Tool"/>
70+
<MakeDir Directories="$(DropPath)\NuGet" />
71+
<MakeDir Directories="$(DropPath)\Chocolatey" />
72+
<MakeDir Directories="$(Root)\ChocolateyBackup" />
73+
<Exec Command="$(Root)src\.NuGet\NuGet.exe pack $(Root)GitReleaseNotes.nuspec -BasePath $(BuildOutputPath) -OutputDirectory $(DropPath)NuGet -Properties Version=$(GitHubFlowVersion_SemVer) -Tool"/>
74+
75+
<Zip Files="@(BuildOutput)"
76+
WorkingDirectory="$(BuildOutputPath)"
77+
ZipFileName="$(DropPath)GitReleaseNotes.$(GitHubFlowVersion_SemVer).zip"
78+
ZipLevel="9" />
79+
80+
<MakeDir Directories="$(Root)\ChocolateyBackup" />
81+
<Copy SourceFiles="$(Root)Chocolatey\tools\chocolateyInstall.ps1"
82+
DestinationFolder="$(Root)\ChocolateyBackup" />
83+
<Copy SourceFiles="$(Root)Chocolatey\GitReleaseNotes.nuspec"
84+
DestinationFolder="$(Root)\ChocolateyBackup" />
85+
86+
<ReplaceFileText InputFilename="$(Root)Chocolatey\tools\chocolateyInstall.ps1"
87+
OutputFilename="$(Root)Chocolatey\tools\chocolateyInstall.ps1"
88+
MatchExpression="__version__"
89+
ReplacementText="$(GitHubFlowVersion_SemVer)" />
90+
91+
<ReplaceFileText InputFilename="$(Root)Chocolatey\GitReleaseNotes.nuspec"
92+
OutputFilename="$(Root)Chocolatey\GitReleaseNotes.nuspec"
93+
MatchExpression="__version__"
94+
ReplacementText="$(GitHubFlowVersion_SemVer)" />
95+
96+
<Exec Command="cpack $(Root)Chocolatey\GitReleaseNotes.nuspec" WorkingDirectory="$(DropPath)\Chocolatey" />
97+
98+
<Copy SourceFiles="$(Root)\ChocolateyBackup\chocolateyInstall.ps1"
99+
DestinationFolder="$(Root)\Chocolatey\tools" />
100+
<Copy SourceFiles="$(Root)ChocolateyBackup\GitReleaseNotes.nuspec"
101+
DestinationFolder="$(Root)\Chocolatey" />
102+
103+
<RemoveDir Directories="$(Root)ChocolateyBackup" />
51104
</Target>
52105
</Project>

0 commit comments

Comments
 (0)