Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
229 changes: 34 additions & 195 deletions .github/workflows/ci-cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -113,75 +113,25 @@ jobs:

# All the following are used only when building an installer after a merge
- name: Build Msi
if: github.event_name != 'pull_request'
id: build_msi
shell: cmd
run: |
msbuild build/FLExBridge.proj /t:CleanMasterOutputDir;PreparePublishingArtifactsInternal;BuildProductBaseMsi /p:UploadFolder=${{ inputs.environment || 'Alpha' }}
if: github.event_name != 'pull_request'

# REVIEW: The .msi file is named with the version, there is probably a cleaner way to generate the correct filename
# and after completing the work to do signing of the bundles it became clear that capturing the files in the signtool wasn't necessary
- name: Prepare for msi signing
shell: bash
run: |
echo "FILES_TO_SIGN=$(cat $FILESTOSIGNLATER)" >> $GITHUB_OUTPUT
id: gathered_files
if: github.event_name != 'pull_request'

- name: upload-msi
id: upload
uses: actions/upload-artifact@v4
with:
name: FlexBridge.msi
path: ${{ steps.gathered_files.outputs.FILES_TO_SIGN }}
if-no-files-found: error
overwrite: true
- name: Sign FlexBridge msi
uses: sillsdev/codesign/trusted-signing-action@v3
if: github.event_name != 'pull_request'

sign-msi:
name: Sign FlexBridge Installer
needs: build_and_test
if: github.event_name != 'pull_request'
uses: sillsdev/codesign/.github/workflows/sign.yml@v2.1
with:
artifact: FlexBridge.msi
description: 'FLEx Bridge Installer'
secrets:
certificate: ${{ secrets.CODESIGN_LSDEVSECTIGOEV }}

build-bundles:
name: Build Installer Bundles
needs: sign-msi
if: github.event_name != 'pull_request'
runs-on: windows-latest
env:
FILESTOSIGNLATER: "${{ github.workspace }}\\filesToSign"
steps:
- name: Checkout Files
uses: actions/checkout@v4
id: checkout
with:
fetch-depth: 0
submodules: true

- name: Downgrade Wix Toolset - remove when runner has 3.14.2
# See: https://github.com/actions/runner-images/issues/9667
run: |
choco uninstall wixtoolset
choco install wixtoolset --version 3.11.2 --allow-downgrade --force
echo "C:\Program Files (x86)\WiX Toolset v3.11\bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append

- name: Add msbuild to PATH
uses: microsoft/setup-msbuild@v2

- name: Download FlexBridge artifact
uses: actions/download-artifact@v4
with:
name: FlexBridge.msi
path: src/WiXInstaller/BaseInstallerBuild # Target directory for the downloaded artifact
credentials: ${{ secrets.TRUSTED_SIGNING_CREDENTIALS }}
files-folder: src/WiXInstaller/BaseInstallerBuild
files-folder-filter: FlexBridge*.msi
description: 'FLExBridge Installer'
description-url: 'https://software.sil.org/fieldworks/help/using-sendreceive/flex-bridge/'

- name: Build Bundles
id: build_bundles
if: github.event_name != 'pull_request'
working-directory: build
shell: cmd
run: |
Expand All @@ -190,156 +140,45 @@ jobs:

- name: Extract burn engines
id: extract_engines
if: github.event_name != 'pull_request'
working-directory: BuildDir
shell: cmd
run: |
insignia -ib FlexBridge_Offline.exe -o offline-engine.exe
insignia -ib FlexBridge_Online.exe -o online-engine.exe

- name: Upload Offline Engine
id: upload-offline-engine
uses: actions/upload-artifact@v4
with:
name: offline-engine
path: BuildDir/offline-engine.exe
if-no-files-found: error
overwrite: true
if: github.event_name != 'pull_request'

- name: Upload Offline Bundle(detatched)
id: upload-offline-bundle
uses: actions/upload-artifact@v4
with:
name: FlexBridge_Offline.exe
path: BuildDir/FlexBridge_Offline.exe
if-no-files-found: error
overwrite: true
- name: Sign Engines
if: github.event_name != 'pull_request'

- name: Upload Online Engine
id: upload-online-engine
uses: actions/upload-artifact@v4
with:
name: online-engine
path: BuildDir/online-engine.exe
if-no-files-found: error
overwrite: true
if: github.event_name != 'pull_request'

- name: Upload Online Bundle(detached)
id: upload-online-bundle
uses: actions/upload-artifact@v4
with:
name: FlexBridge_Online.exe
path: BuildDir/FlexBridge_Online.exe
if-no-files-found: error
overwrite: true
if: github.event_name != 'pull_request'

sign-offline-engine:
name: Sign Offline Engine
needs: build-bundles
if: github.event_name != 'pull_request'
uses: sillsdev/codesign/.github/workflows/sign.yml@v2.1
with:
artifact: offline-engine
description: 'FLEx Bridge Installer'
secrets:
certificate: ${{ secrets.CODESIGN_LSDEVSECTIGOEV }}

sign-online-engine:
name: Sign Online Engine
needs: build-bundles
if: github.event_name != 'pull_request'
uses: sillsdev/codesign/.github/workflows/sign.yml@v2.1
with:
artifact: online-engine
description: 'FLEx Bridge Installer'
secrets:
certificate: ${{ secrets.CODESIGN_LSDEVSECTIGOEV }}

reattach-engines:
runs-on: windows-latest
needs: [sign-offline-engine, sign-online-engine]
steps:
- name: Downgrade Wix Toolset - remove when runner has 3.14.2
run: |
choco uninstall wixtoolset
choco install wixtoolset --version 3.11.2 --allow-downgrade --force
echo "C:\Program Files (x86)\WiX Toolset v3.11\bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append

- name: Download signed online engine
uses: actions/download-artifact@v4
with:
name: online-engine
- name: Download signed offline engine
uses: actions/download-artifact@v4
with:
name: offline-engine
- name: Download Online Bundle
uses: actions/download-artifact@v4
with:
name: FlexBridge_Online.exe
- name: Download Offline Bundle
uses: actions/download-artifact@v4
with:
name: FlexBridge_Offline.exe

uses: sillsdev/codesign/trusted-signing-action@v3
with:
credentials: ${{ secrets.TRUSTED_SIGNING_CREDENTIALS }}
files-folder: BuildDir
files-folder-filter: '*-engine.exe'
description: 'FLExBridge installer burn engine - SIL Global'
description-url: 'https://software.sil.org/fieldworks/help/using-sendreceive/flex-bridge/'

- name: Reattach Engines
if: github.event_name != 'pull_request'
working-directory: BuildDir
shell: cmd
run: |
insignia -ab online-engine.exe FlexBridge_Online.exe -o FlexBridge_Online.exe
insignia -ab offline-engine.exe FlexBridge_Offline.exe -o FlexBridge_Offline.exe

- name: Upload Online Bundle(attached)
id: upload-online-bundle
uses: actions/upload-artifact@v4
with:
name: FlexBridge_Online.exe
path: FlexBridge_Online.exe
if-no-files-found: error
overwrite: true
- name: Sign Bundles
if: github.event_name != 'pull_request'

- name: Upload Offline Bundle(attached)
id: upload-offline-bundle
uses: sillsdev/codesign/trusted-signing-action@v3
with:
credentials: ${{ secrets.TRUSTED_SIGNING_CREDENTIALS }}
files-folder: BuildDir
files-folder-filter: FlexBridge_*.exe
description: 'FLExBridge installer - SIL Global'
description-url: 'https://software.sil.org/fieldworks/help/using-sendreceive/flex-bridge/'

- name: Upload Signed Installers
uses: actions/upload-artifact@v4
with:
name: FlexBridge_Offline.exe
path: FlexBridge_Offline.exe
if-no-files-found: error
overwrite: true
if: github.event_name != 'pull_request'

- name: Cleanup Offline Engine
uses: geekyeggo/delete-artifact@v5
with:
name: offline-engine

- name: Cleanup Online Engine
uses: geekyeggo/delete-artifact@v5
with:
name: online-engine

sign-offline-bundle:
name: Sign Offline Bundle
needs: reattach-engines
if: github.event_name != 'pull_request'
uses: sillsdev/codesign/.github/workflows/sign.yml@v2.1
with:
artifact: FlexBridge_Offline.exe
description: 'FLEx Bridge Installer'
secrets:
certificate: ${{ secrets.CODESIGN_LSDEVSECTIGOEV }}

sign-online-bundle:
name: Sign Online Bundle
needs: reattach-engines
if: github.event_name != 'pull_request'
uses: sillsdev/codesign/.github/workflows/sign.yml@v2.1
with:
artifact: FlexBridge_Online.exe
description: 'FLEx Bridge Installer'
secrets:
certificate: ${{ secrets.CODESIGN_LSDEVSECTIGOEV }}

name: FlexBridgeInstallers
path: BuildDir/FlexBridge_*.exe
if-no-files-found: warn
4 changes: 1 addition & 3 deletions Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,12 @@
<Company>SIL</Company>
<Authors>SIL International</Authors>
<Product>FLExBridge</Product>
<Copyright>Copyright © 2010-2021 SIL International</Copyright>
<Copyright>Copyright © 2010-2025 SIL International</Copyright>
<PackageLicenseExpression>MIT</PackageLicenseExpression>
<PackageProjectUrl>https://github.com/sillsdev/flexbridge</PackageProjectUrl>
<PackageRequireLicenseAcceptance>false</PackageRequireLicenseAcceptance>
<OutputPath>../../output/$(Configuration)</OutputPath>
<PackageOutputPath>../../output</PackageOutputPath>
<SignAssembly>true</SignAssembly>
<AssemblyOriginatorKeyFile>$(MSBuildThisFileDirectory)/Flexbridge.snk</AssemblyOriginatorKeyFile>
<ResolveAssemblyWarnOrErrorOnTargetArchitectureMismatch>None</ResolveAssemblyWarnOrErrorOnTargetArchitectureMismatch>
<IncludeSymbols>true</IncludeSymbols>
<SymbolPackageFormat>snupkg</SymbolPackageFormat>
Expand Down
Binary file removed Flexbridge.snk
Binary file not shown.
1 change: 0 additions & 1 deletion build/WixPatchableInstaller.targets
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,6 @@
<FilesForDevelopers Include="$(RootBinDir)\**\*Tests.*"/>
<FilesForDevelopers Include="$(RootBinDir)\**\*TestApp.*"/>
<FilesForDevelopers Include="$(RootBinDir)\**\*TestUtilities.*"/>
<FilesForDevelopers Include="$(RootBinDir)\RepositoryUtility.*"/>
<FilesInstalledByChorusMerge Include="$(RootBinDir)\Autofac.dll;
$(RootBinDir)\LibChorus.dll;
$(RootBinDir)\Chorus.exe;
Expand Down
6 changes: 3 additions & 3 deletions src/FLEx-ChorusPlugin/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,6 @@
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;

[assembly: InternalsVisibleTo("FLEx-ChorusPluginTests, PublicKey=0024000004800000940000000602000000240000525341310004000001000100b511304f05af0a01cbc5408cdbdf742aa1664db0e1157235bb2619e7fb5e705bd3534a7157a088a458ec3136e46ebd2b73519fb07dffd2daa40a7b9aa340675d926ab918d2e0183b8613320529b8a490028c8e1b40b980f3724928455d447d8f93d459be3c55a4e3f2ef5119c3393fd25adba301cbff8a3ffbce2e181d143788")]
[assembly: InternalsVisibleTo("RepositoryUtility, PublicKey=0024000004800000940000000602000000240000525341310004000001000100b511304f05af0a01cbc5408cdbdf742aa1664db0e1157235bb2619e7fb5e705bd3534a7157a088a458ec3136e46ebd2b73519fb07dffd2daa40a7b9aa340675d926ab918d2e0183b8613320529b8a490028c8e1b40b980f3724928455d447d8f93d459be3c55a4e3f2ef5119c3393fd25adba301cbff8a3ffbce2e181d143788")]
[assembly: InternalsVisibleTo("FwdataTestApp, PublicKey=0024000004800000940000000602000000240000525341310004000001000100b511304f05af0a01cbc5408cdbdf742aa1664db0e1157235bb2619e7fb5e705bd3534a7157a088a458ec3136e46ebd2b73519fb07dffd2daa40a7b9aa340675d926ab918d2e0183b8613320529b8a490028c8e1b40b980f3724928455d447d8f93d459be3c55a4e3f2ef5119c3393fd25adba301cbff8a3ffbce2e181d143788")]
[assembly: InternalsVisibleTo("FLEx-ChorusPluginTests")]
[assembly: InternalsVisibleTo("RepositoryUtility")]
[assembly: InternalsVisibleTo("FwdataTestApp")]
7 changes: 7 additions & 0 deletions src/Installer/Installer.wxs
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,11 @@ are trying to support, you're better off using non-advertised shortcuts. "-->
<File Id="about.htm" Name="about.htm" KeyPath="yes" Source="..\..\output\Installer\about.htm" />
</Component>

<!-- RepositoryUtility debugging tool -->
<Component Id="RepositoryUtility.exe" Guid="15FC8E47-B443-447E-967B-586076BA2B13">
<File Id="RepositoryUtility.exe" Name="RepositoryUtility.exe" KeyPath="yes" Source="..\..\output\Release\net462\RepositoryUtility.exe"/>
</Component>

<Merge Id="ChorusMergeModule" Language="1033" SourceFile="..\..\lib\Release\ChorusMergeModule.msm" DiskId="1"/>
</Directory>
</Directory>
Expand Down Expand Up @@ -219,6 +224,8 @@ are trying to support, you're better off using non-advertised shortcuts. "-->

<ComponentRef Id="about.htm" />

<ComponentRef Id="RepositoryUtility.exe" />

<MergeRef Id="ChorusMergeModule"/>
<MergeRef Id="CRT90"/>
<MergeRef Id="CRT90Policy"/>
Expand Down
2 changes: 1 addition & 1 deletion src/LfMergeBridge/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@
using System.Runtime.InteropServices;
using System.Runtime.CompilerServices;

[assembly: InternalsVisibleTo("LfMergeBridgeTests, PublicKey=0024000004800000940000000602000000240000525341310004000001000100b511304f05af0a01cbc5408cdbdf742aa1664db0e1157235bb2619e7fb5e705bd3534a7157a088a458ec3136e46ebd2b73519fb07dffd2daa40a7b9aa340675d926ab918d2e0183b8613320529b8a490028c8e1b40b980f3724928455d447d8f93d459be3c55a4e3f2ef5119c3393fd25adba301cbff8a3ffbce2e181d143788")]
[assembly: InternalsVisibleTo("LfMergeBridgeTests")]
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// --------------------------------------------------------------------------------------------
// --------------------------------------------------------------------------------------------
// Copyright (C) 2015-2017 SIL International. All rights reserved.
//
// Distributable under the terms of the MIT License.
Expand All @@ -15,9 +15,7 @@
using Chorus.merge;
using Chorus.merge.xml.generic;
using Chorus.VcsDrivers.Mercurial;
using LibFLExBridgeChorusPlugin.Handling;
using LibFLExBridgeChorusPlugin.Infrastructure;
using LibTriboroughBridgeChorusPlugin;
using SIL.IO;

namespace LibFLExBridgeChorusPlugin.Handling.ConfigLayout
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -101,27 +101,27 @@ private bool RunFixFwData(IProgress progress)
{
using (var process = new Process())
{
var startInfo = process.StartInfo;
startInfo.FileName = _fixitPathname.Replace("\"", null);
startInfo.Arguments = "\"" + _fwdataPathname.Replace("\"", null) + "\"";
startInfo.CreateNoWindow = false;
startInfo.UseShellExecute = false;
startInfo.WorkingDirectory = Path.GetDirectoryName(_fixitPathname) ?? string.Empty;
startInfo.RedirectStandardOutput = true;
process.Start();
var mergeOutput = process.StandardOutput.ReadToEnd();
process.WaitForExit();
// If the user requests verbose output they can see all the fixup reports.
// Unfortunately this includes sequences of dots intended to show progress on the console.
// They always occur at the start of a line. The Replace gets rid of them.
progress.WriteVerbose(new Regex(@"(?<=(^|\n|\r))\.+").Replace(mergeOutput, ""));
// 0 means fixup ran but fixed nothing, 1 means it ran and fixed something, anything else is a problem
if(process.ExitCode != 0 && process.ExitCode != 1)
{
throw new Exception("Merge fixing program has crashed.");
var startInfo = process.StartInfo;
startInfo.FileName = _fixitPathname.Replace("\"", null);
startInfo.Arguments = "\"" + _fwdataPathname.Replace("\"", null) + "\"";
startInfo.CreateNoWindow = false;
startInfo.UseShellExecute = false;
startInfo.WorkingDirectory = Path.GetDirectoryName(_fixitPathname) ?? string.Empty;
startInfo.RedirectStandardOutput = true;
process.Start();
var mergeOutput = process.StandardOutput.ReadToEnd();
process.WaitForExit();
// If the user requests verbose output they can see all the fixup reports.
// Unfortunately this includes sequences of dots intended to show progress on the console.
// They always occur at the start of a line. The Replace gets rid of them.
progress.WriteVerbose(new Regex(@"(?<=(^|\n|\r))\.+").Replace(mergeOutput, ""));
// 0 means fixup ran but fixed nothing, 1 means it ran and fixed something, anything else is a problem
if(process.ExitCode != 0 && process.ExitCode != 1)
{
throw new Exception("Merge fixing program has crashed.");
}
return process.ExitCode == 1;
}
return process.ExitCode == 1;
}
}

/// <summary>
Expand Down
Loading
Loading