Skip to content

Commit

Permalink
Build Chorus Hub Installer with GHA (#314)
Browse files Browse the repository at this point in the history
* Build Chorus Hub Installer with GitHub Actions
* Update a deprecated WiX attribute
* clean up (completes #299)
* check out help in a clean location
  • Loading branch information
papeh authored Dec 12, 2022
1 parent 33fd8cf commit 9547608
Show file tree
Hide file tree
Showing 6 changed files with 48 additions and 127 deletions.
20 changes: 17 additions & 3 deletions .github/workflows/dotnet.yml
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,7 @@ jobs:
uses: actions/checkout@2541b1294d2704b0964813337f33b291d3f8596b # v3.0.2
with:
repository: sillsdev/chorushelp
path: lib
clean: false # don't delete other files from lib
path: DistFiles/Help
if: matrix.os == 'windows-latest'

- name: Add msbuild to PATH
Expand All @@ -87,7 +86,7 @@ jobs:
run: msbuild src/Installer/ChorusMergeModule.wixproj -t:pack
if: matrix.os == 'windows-latest'

- name: Upload Merge Modules
- name: Upload Merge Module
uses: actions/upload-artifact@3cea5372237819ed00197afe530f5a7ea3e805c8 # v3.1.0
with:
name: chorus-merge-module
Expand All @@ -96,6 +95,21 @@ jobs:
output/*.nupkg
if: matrix.os == 'windows-latest'

- name: Build Chorus Hub Installer
run: |
msbuild src/Installer/ChorusHub.wixproj /t:Restore
msbuild src/Installer/ChorusHub.wixproj /t:StampLicenseYear
msbuild src/Installer/ChorusHub.wixproj /t:Build
if: matrix.os == 'windows-latest'

- name: Upload Chorus Hub Installer
uses: actions/upload-artifact@3cea5372237819ed00197afe530f5a7ea3e805c8 # v3.1.0
with:
name: chorus-hub-installer
path: |
output/Release/*.msi
if: matrix.os == 'windows-latest'

- name: Pack
run: dotnet pack --no-restore --no-build -c Release

Expand Down
96 changes: 0 additions & 96 deletions build/Chorus.proj

This file was deleted.

46 changes: 26 additions & 20 deletions src/Installer/ChorusHub.wixproj
Original file line number Diff line number Diff line change
@@ -1,26 +1,22 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- NB: rather than bothering with GitVersion here, we simply expect the version to be lingering in the environment from previous runs.
This is supported by .github/workflows/dotnet.yml -->
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Release</Configuration>
<Platform Condition=" '$(Platform)' == '' ">x86</Platform>
<ProductVersion>3.5</ProductVersion>
<ProductVersion>$(GitVersion_AssemblySemVer)</ProductVersion>
<ProjectGuid>c1ee5822-e382-11de-8a39-0800200c9a66</ProjectGuid>
<SchemaVersion>2.0</SchemaVersion>
<OutputName>ChorusHubInstaller</OutputName>
<OutputType>Package</OutputType>
<OutputPath>..\..\output\$(Configuration)\</OutputPath>
<WixTargetsPath Condition=" '$(WixTargetsPath)' == '' AND '$(MSBuildExtensionsPath32)' != '' ">$(MSBuildExtensionsPath32)\Microsoft\WiX\v3.x\Wix.targets</WixTargetsPath>
<WixTargetsPath Condition=" '$(WixTargetsPath)' == '' ">$(MSBuildExtensionsPath)\Microsoft\WiX\v3.x\Wix.targets</WixTargetsPath>
<Name>ChorusHubInstaller</Name>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x86' ">
<OutputPath>..\..\output\Debug\</OutputPath>
<IntermediateOutputPath>obj\Debug\</IntermediateOutputPath>
<DefineConstants>Debug</DefineConstants>
<SuppressPdbOutput>True</SuppressPdbOutput>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x86' ">
<OutputPath>..\..\output\Release\</OutputPath>
<IntermediateOutputPath>obj\Release\</IntermediateOutputPath>
<DefineConstants>ProductVersion=$(ProductVersion)</DefineConstants>
<DefineConstants Condition="'$(Configuration)' == 'Debug'">Debug;$(DefineConstants)</DefineConstants>
<DefineSolutionProperties>false</DefineSolutionProperties>
<SuppressPdbOutput>True</SuppressPdbOutput>
</PropertyGroup>
<ItemGroup>
Expand All @@ -47,12 +43,22 @@
</WixExtension>
</ItemGroup>
<Import Project="$(WixTargetsPath)" />
<!--
To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Wix.targets.
<Target Name="BeforeBuild">
</Target>
<Target Name="AfterBuild">
</Target>
-->
</Project>

<!-- Stamp Years -->
<Import Project="NuGet.targets" />
<PropertyGroup>
<SilBuildTasksVersion>2.5.0</SilBuildTasksVersion>
<SilBuildTasksDll>$(NuGetToolsPath)/packages/SIL.BuildTasks.$(SilBuildTasksVersion)/tools/SIL.BuildTasks.dll</SilBuildTasksDll>
</PropertyGroup>

<UsingTask TaskName="FileUpdate" AssemblyFile="$(SilBuildTasksDll)" Condition="Exists('$(SilBuildTasksDll)')" />

<Target Name="Restore" DependsOnTargets="CheckPrerequisites">
<Exec Command='$(NuGetCommand) install SIL.BuildTasks -version $(SilBuildTasksVersion) -solutionDirectory $(NuGetToolsPath)'
Condition="!Exists('$(SilBuildTasksDll)')" />
</Target>

<Target Name="StampLicenseYear" DependsOnTargets="Restore">
<FileUpdate File="resources\License.rtf" RegEx='COPYRIGHTYEARPLACEHOLDER' ReplacementText="$([System.DateTime]::Now.ToString(yyyy))" />
</Target>
</Project>
11 changes: 4 additions & 7 deletions src/Installer/ChorusHub.wxs
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
<?xml version="1.0" encoding="UTF-8"?>
<!-- These variables define the Windows Installer product version, product code and upgrade code. They -->
<!-- will be used later on in this file. -->
<?define Property_ProductVersion = ".*" ?>
<!-- Generate a new one for each installer, since it only uses the major upgrade approach for msi installers.
cf: http://wix.sourceforge.net/manual-wix3/major_upgrade.htm
and http://www.joyofsetup.com/2010/01/16/major-upgrades-now-easier-than-ever/
Expand All @@ -14,9 +11,9 @@ for details on why going the major upgrade route is the right answer for an msi-
http://blogs.msdn.com/robmen/archive/2003/10/04/56479.aspx -->

<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi" xmlns:fire="http://schemas.microsoft.com/wix/FirewallExtension" xmlns:util="http://schemas.microsoft.com/wix/UtilExtension">
<Product Id="$(var.Property_ProductCode)" Name="Chorus Hub $(var.Property_ProductVersion)" Language="1033" Version="$(var.Property_ProductVersion)" Manufacturer="SIL" UpgradeCode="$(var.Property_UpgradeCode)">
<Product Id="$(var.Property_ProductCode)" Name="Chorus Hub $(var.ProductVersion)" Language="1033" Version="$(var.ProductVersion)" Manufacturer="SIL" UpgradeCode="$(var.Property_UpgradeCode)">
<!-- autogenerated package id -->
<Package Id="*" Compressed="yes" InstallerVersion="200" InstallScope="perMachine" />
<Package Id="*" Compressed="yes" InstallerVersion="300" InstallScope="perMachine" />
<WixVariable Id="WixUILicenseRtf" Value="resources\License.rtf" />
<WixVariable Id="WixUIDialogBmp" Value="resources\MSIBackground.bmp" />

Expand Down Expand Up @@ -71,7 +68,7 @@ http://blogs.msdn.com/robmen/archive/2003/10/04/56479.aspx -->
<!--<fire:FirewallException Id="ChorusHubFireWallException" Name="Chorus Hub Send/Receive Client" Program="[#ChorusHub.exe]" Scope="localSubnet" IgnoreFailure="yes"/> -->
</Component>
<Component Id="RegInstallationDir" Guid="C1EECD52-E382-11DE-8A39-0800200C9A66">
<RegistryKey Id="keyChorusHub.exe" Action="createAndRemoveOnUninstall" Root="HKLM" Key="SOFTWARE\[Manufacturer]\Chorus Hub">
<RegistryKey Id="keyChorusHub.exe" ForceDeleteOnUninstall="yes" Root="HKLM" Key="SOFTWARE\[Manufacturer]\Chorus Hub">
<RegistryValue Id="ChorusHubInstallationDir" Type="string" Value="[INSTALLDIR]" Name="InstallationDir"/>
</RegistryKey>
</Component>
Expand All @@ -84,7 +81,7 @@ http://blogs.msdn.com/robmen/archive/2003/10/04/56479.aspx -->
<File Id="Autofac.dll" Name="Autofac.dll" KeyPath="yes" Source="..\..\output\Release\net461\Autofac.dll" />
</Component>
<Component Id="chorushelp.chm" Guid="C1EECD56-E382-11DE-8A39-0800200C9A66">
<File Id="chorushelp.chm" Name="Chorus_Help.chm" KeyPath="yes" Source="..\..\lib\Chorus_Help.chm"/>
<File Id="chorushelp.chm" Name="Chorus_Help.chm" KeyPath="yes" Source="..\..\DistFiles\Help\Chorus_Help.chm"/>
</Component>
<!-- used by chorus help -->
<Component Id="Vulcan.Uczniowie.HelpProvider.dll" Guid="C1EEF450-E382-11DE-8A39-0800200C9A66">
Expand Down
2 changes: 1 addition & 1 deletion src/Installer/ChorusMergeModule.wxs
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ http://blogs.msdn.com/robmen/archive/2003/10/04/56479.aspx -->
<File Id="chorusmerge.exe" Name="chorusmerge.exe" KeyPath="yes" Source="..\..\output\Release\net461\chorusmerge.exe" />
</Component>
<Component Id="chorushelp.chm" Guid="C1EDBBE9-E382-11DE-8A39-0800200C9A66">
<File Id="chorushelp.chm" Name="Chorus_Help.chm" KeyPath="yes" Source="..\..\lib\Chorus_Help.chm"/>
<File Id="chorushelp.chm" Name="Chorus_Help.chm" KeyPath="yes" Source="..\..\DistFiles\Help\Chorus_Help.chm"/>
</Component>

<!-- used by chorus help -->
Expand Down
Binary file modified src/Installer/resources/License.rtf
Binary file not shown.

0 comments on commit 9547608

Please sign in to comment.