Skip to content

Commit 2d04620

Browse files
authored
Add WinGet project (#15)
* wix * linqpad * update * netcore * netcore fixes * GitHubReleaseNotes.NETCore3 * 1.0.6
1 parent 2644ead commit 2d04620

File tree

13 files changed

+303
-21
lines changed

13 files changed

+303
-21
lines changed

Wix/1.0.5.3.yaml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
Id: StefHeyenrath.GitHubReleaseNotes
2+
Version: 1.0.5.3
3+
Name: GitHubReleaseNotes
4+
AppMoniker: GitHubReleaseNotes
5+
Publisher: Stef Heyenrath
6+
License: MIT
7+
LicenseUrl: https://github.com/StefH/GitHubReleaseNotes/blob/master/LICENSE
8+
Homepage: https://github.com/StefH/GitHubReleaseNotes
9+
Description: Generate Release Notes in MarkDown format from a GitHub project.
10+
Tags: "github, markdown, releasenotes, changelog, tags, generate, md"
11+
InstallerType: Msi
12+
Installers:
13+
- Arch: x64
14+
Url: https://github.com/StefH/GitHubReleaseNotes/releases/download/1.0.5.3/Setup.msi
15+
Sha256: F08F2D2292E15A9B9BA90E8B6CC4C3C412D6B1069D1EF9EDC7DA67337566F567

Wix/1.0.6.yaml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
Id: StefHeyenrath.GitHubReleaseNotes
2+
Version: 1.0.6
3+
Name: GitHubReleaseNotes
4+
AppMoniker: GitHubReleaseNotes
5+
Publisher: Stef Heyenrath
6+
License: MIT
7+
LicenseUrl: https://github.com/StefH/GitHubReleaseNotes/blob/master/LICENSE
8+
Homepage: https://github.com/StefH/GitHubReleaseNotes
9+
Description: Generate Release Notes in MarkDown format from a GitHub project.
10+
Tags: "github, markdown, releasenotes, changelog, tags, generate, md"
11+
InstallerType: Msi
12+
Installers:
13+
- Arch: x64
14+
Url: https://github.com/StefH/GitHubReleaseNotes/releases/download/1.0.6/Setup.msi
15+
Sha256: ED5A701FC5F07E667AFE9CAA08CC8E43A592CBA1F3BE5081FC8943A1F8CC5106

Wix/HowTo.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# HowTo
2+
3+
## Update release
4+
- Do Chocolatey first
5+
6+
## Build
7+
- Build in release mode
8+
- Build setup project
9+
10+
## Generate YML
11+
Use LinqPad to generate the yml file

Wix/Setup/Product.wxs

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
3+
<Product Id="*" Name="GitHubReleaseNotes" Language="1033" Version="1.0.0.0" Manufacturer="Stef Heyenrath" UpgradeCode="ca1f74e0-dfca-4774-ae65-9421b4d08ff2">
4+
<Package InstallerVersion="200" Compressed="yes" InstallScope="perMachine" />
5+
6+
<MajorUpgrade DowngradeErrorMessage="A newer version of [ProductName] is already installed." />
7+
<MediaTemplate EmbedCab="yes" />
8+
9+
<Feature Id="ProductFeature" Title="GitHubReleaseNotes" Level="1">
10+
<ComponentGroupRef Id="ProductComponents" />
11+
</Feature>
12+
</Product>
13+
14+
<Fragment>
15+
<Directory Id="TARGETDIR" Name="SourceDir">
16+
<Directory Id="ProgramFilesFolder">
17+
<Directory Id="INSTALLFOLDER" Name="GitHubReleaseNotes" />
18+
</Directory>
19+
</Directory>
20+
</Fragment>
21+
22+
<Fragment>
23+
<ComponentGroup Id="ProductComponents" Directory="INSTALLFOLDER">
24+
<Component Id="ProductComponent">
25+
<File Source="$(var.GitHubReleaseNotes.TargetPath)" />
26+
27+
<Environment Id="PATH" Name="PATH" Value="[INSTALLFOLDER]" Permanent="no" Part="last" Action="set" System="yes" />
28+
</Component>
29+
</ComponentGroup>
30+
</Fragment>
31+
</Wix>

Wix/Setup/Setup.wixproj

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<Project ToolsVersion="4.0" DefaultTargets="Build" InitialTargets="EnsureWixToolsetInstalled" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3+
<PropertyGroup>
4+
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
5+
<Platform Condition=" '$(Platform)' == '' ">x86</Platform>
6+
<ProductVersion>3.10</ProductVersion>
7+
<ProjectGuid>9456d153-cbdd-470b-9bff-17c145ed9c24</ProjectGuid>
8+
<SchemaVersion>2.0</SchemaVersion>
9+
<OutputName>Setup</OutputName>
10+
<OutputType>Package</OutputType>
11+
<Name>Setup</Name>
12+
</PropertyGroup>
13+
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x86' ">
14+
<OutputPath>bin\$(Configuration)\</OutputPath>
15+
<IntermediateOutputPath>obj\$(Configuration)\</IntermediateOutputPath>
16+
<DefineConstants>Debug</DefineConstants>
17+
</PropertyGroup>
18+
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x86' ">
19+
<OutputPath>bin\$(Configuration)\</OutputPath>
20+
<IntermediateOutputPath>obj\$(Configuration)\</IntermediateOutputPath>
21+
</PropertyGroup>
22+
<ItemGroup>
23+
<Compile Include="Product.wxs" />
24+
</ItemGroup>
25+
<ItemGroup>
26+
<ProjectReference Include="..\..\src\GitHubReleaseNotes\GitHubReleaseNotes.csproj">
27+
<Name>GitHubReleaseNotes</Name>
28+
<Project>{b6269aac-170a-43d0-8b9b-579ded3d9a00}</Project>
29+
<Private>True</Private>
30+
<DoNotHarvest>True</DoNotHarvest>
31+
<RefProjectOutputGroups>Binaries;Content;Satellites</RefProjectOutputGroups>
32+
<RefTargetDir>INSTALLFOLDER</RefTargetDir>
33+
</ProjectReference>
34+
</ItemGroup>
35+
<Import Project="$(WixTargetsPath)" Condition=" '$(WixTargetsPath)' != '' " />
36+
<Import Project="$(MSBuildExtensionsPath32)\Microsoft\WiX\v3.x\Wix.targets" Condition=" '$(WixTargetsPath)' == '' AND Exists('$(MSBuildExtensionsPath32)\Microsoft\WiX\v3.x\Wix.targets') " />
37+
<Target Name="EnsureWixToolsetInstalled" Condition=" '$(WixTargetsImported)' != 'true' ">
38+
<Error Text="The WiX Toolset v3.11 (or newer) build tools must be installed to build this project. To download the WiX Toolset, see http://wixtoolset.org/releases/" />
39+
</Target>
40+
<!--
41+
To modify your build process, add your task inside one of the targets below and uncomment it.
42+
Other similar extension points exist, see Wix.targets.
43+
<Target Name="BeforeBuild">
44+
</Target>
45+
<Target Name="AfterBuild">
46+
</Target>
47+
-->
48+
</Project>

Wix/generate manifest.linq

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
<Query Kind="Statements" />
2+
3+
// LinqPad script to generate the `manifest.yaml` file
4+
5+
// Get the folder where this LinqPad script is located (https://stackoverflow.com/questions/3802779/linqpad-script-directory)
6+
string folder = Path.GetDirectoryName(Util.CurrentQueryPath);
7+
string chocolateyFolder = Path.Combine(folder, "../", "Chocolatey", "GithubReleaseNotes");
8+
9+
var doc = new XmlDocument(); doc.Load(Path.Combine(chocolateyFolder, "GitHubReleaseNotes.nuspec"));
10+
string version = doc["package"]["metadata"]["version"].FirstChild.Value;
11+
string msi = Path.Combine(folder, "Setup", "bin", "release", "Setup.msi");
12+
13+
string CreateSHA256()
14+
{
15+
var crypt = new System.Security.Cryptography.SHA256Managed();
16+
var hash = new System.Text.StringBuilder();
17+
byte[] crypto = crypt.ComputeHash(File.ReadAllBytes(msi));
18+
foreach (byte theByte in crypto)
19+
{
20+
hash.Append(theByte.ToString("x2"));
21+
}
22+
return hash.ToString().ToUpperInvariant();
23+
}
24+
25+
string text =
26+
$@"Id: StefHeyenrath.GitHubReleaseNotes
27+
Version: {version}
28+
Name: GitHubReleaseNotes
29+
AppMoniker: GitHubReleaseNotes
30+
Publisher: Stef Heyenrath
31+
License: MIT
32+
LicenseUrl: https://github.com/StefH/GitHubReleaseNotes/blob/master/LICENSE
33+
Homepage: https://github.com/StefH/GitHubReleaseNotes
34+
Description: Generate Release Notes in MarkDown format from a GitHub project.
35+
Tags: ""github, markdown, releasenotes, changelog, tags, generate, md""
36+
InstallerType: Msi
37+
Installers:
38+
- Arch: x64
39+
Url: https://github.com/StefH/GitHubReleaseNotes/releases/download/{version}/Setup.msi
40+
Sha256: {CreateSHA256()}";
41+
42+
File.WriteAllText(Path.Combine(folder, $"{version}.yaml"), text, Encoding.UTF8);
43+
44+
$"Manifest yaml is generated for {version}".Dump();

src/GitHubReleaseNotes.Logic/GitHubReleaseNotes.Logic.csproj

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
<PropertyGroup>
44
<TargetFrameworks>net46;net472;netstandard2.0</TargetFrameworks>
55
<ProjectGuid>{B6269AAC-170A-43D0-8B9B-579DED3D9A99}</ProjectGuid>
6+
<PackageIcon>icon.png</PackageIcon>
67
</PropertyGroup>
78

89
<ItemGroup>
@@ -14,4 +15,8 @@
1415
<PackageReference Include="Octokit" Version="0.48.0" />
1516
<PackageReference Include="Handlebars.Net" Version="1.9.5" />
1617
</ItemGroup>
18+
19+
<ItemGroup>
20+
<None Include="../../icon.png" Pack="true" PackagePath="" />
21+
</ItemGroup>
1722
</Project>
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
<Project Sdk="Microsoft.NET.Sdk">
2+
3+
<PropertyGroup>
4+
<OutputType>Exe</OutputType>
5+
<TargetFramework>netcoreapp3.1</TargetFramework>
6+
<AssemblyName>GitHubReleaseNotes</AssemblyName>
7+
<RootNamespace>GitHubReleaseNotes</RootNamespace>
8+
<PackageIcon>icon.png</PackageIcon>
9+
<ProjectGuid>{E851802A-C1F1-47BB-8725-1FD1868CC6EB}</ProjectGuid>
10+
<SelfContained>True</SelfContained>
11+
<RuntimeIdentifier>win-x64</RuntimeIdentifier>
12+
</PropertyGroup>
13+
14+
<ItemGroup>
15+
<Compile Include="..\GitHubReleaseNotes\ConfigurationParser.cs" Link="ConfigurationParser.cs" />
16+
<Compile Include="..\GitHubReleaseNotes\SimpleCommandLineParser.cs" Link="SimpleCommandLineParser.cs" />
17+
</ItemGroup>
18+
19+
<ItemGroup>
20+
<ProjectReference Include="..\GitHubReleaseNotes.Logic\GitHubReleaseNotes.Logic.csproj" />
21+
</ItemGroup>
22+
23+
<ItemGroup>
24+
<None Include="../../icon.png" Pack="true" PackagePath="" />
25+
</ItemGroup>
26+
27+
</Project>
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
using System;
2+
using System.Reflection;
3+
using System.Threading.Tasks;
4+
using GitHubReleaseNotes.Logic;
5+
6+
namespace GitHubReleaseNotes
7+
{
8+
class Program
9+
{
10+
static async Task Main(string[] args)
11+
{
12+
var configuration = ConfigurationParser.Parse(args);
13+
14+
Console.WriteLine($"GitHubReleaseNotes ({Assembly.GetExecutingAssembly().GetName().Version})");
15+
await new Generator(configuration).GenerateAsync();
16+
}
17+
}
18+
}
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<!--
3+
https://go.microsoft.com/fwlink/?LinkID=208121.
4+
-->
5+
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
6+
<PropertyGroup>
7+
<Configuration>Release</Configuration>
8+
<Platform>Any CPU</Platform>
9+
<PublishDir>bin\Release\netcoreapp3.1\win-x64\publish\</PublishDir>
10+
<PublishProtocol>FileSystem</PublishProtocol>
11+
<TargetFramework>netcoreapp3.1</TargetFramework>
12+
<RuntimeIdentifier>win-x64</RuntimeIdentifier>
13+
<SelfContained>true</SelfContained>
14+
<PublishSingleFile>True</PublishSingleFile>
15+
<PublishReadyToRun>False</PublishReadyToRun>
16+
<PublishTrimmed>True</PublishTrimmed>
17+
</PropertyGroup>
18+
</Project>

0 commit comments

Comments
 (0)