diff --git a/.github/workflows/ci-cd.yml b/.github/workflows/ci-cd.yml index e240e658..f944bb67 100644 --- a/.github/workflows/ci-cd.yml +++ b/.github/workflows/ci-cd.yml @@ -5,6 +5,11 @@ on: pull_request: branches: ["develop", "master"] workflow_dispatch: + inputs: + releaseType: + description: 'Alpha, Beta, Stable used to stamp release artifacts' + required: true + default: 'Alpha' concurrency: group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} @@ -38,15 +43,15 @@ jobs: - name: Add msbuild to PATH uses: microsoft/setup-msbuild@v2 + # We need the dotnet runtime to execute overcrowdin - name: Setup dotnet uses: actions/setup-dotnet@v3 with: - dotnet-version: | - 2.1.x - 3.1.x - 5.0.x + dotnet-version: + 8.0.x if: github.event_name != 'pull_request' + # If we are just doing a CI build we don't need real localizations, but the location must exist - name: Add Fake Localizations for CI shell: bash run: echo > DistFiles/localizations/empty.xlf @@ -62,11 +67,13 @@ jobs: shell: cmd run: msbuild build\FLExBridge.proj /t:Test + # All the following are used only when building an installer after a merge - name: Install Latest Overcrowdin shell: cmd run: dotnet tool install -g overcrowdin if: github.event_name != 'pull_request' + - name: Restore L10n Packages shell: cmd run: | @@ -81,7 +88,41 @@ jobs: msbuild l10n.proj /t:GetLatestL10ns;CopyL10nsToDistFiles if: github.event_name != 'pull_request' - - name: Build Installer + - name: Build Msi shell: cmd - run: msbuild build/FLExBridge.proj /t:Installer /p:UploadFolder=Alpha + run: msbuild build/FLExBridge.proj /t:CleanMasterOutputDir;PreparePublishingArtifactsInternal;BuildProductBaseMsi /p:UploadFolder=${{ inputs.environment || 'Alpha' }} if: github.event_name != 'pull_request' + + - name: Find versioned msi file + id: find_file + run: | + find . -name "FLExBridge*.msi" > files.txt + + # Read the first matching file found (should only be one) and store it as an output variable + head -n 1 files.txt > first_file.txt + echo "::set-output name=fb_msi_path::$(cat first_file.txt)" + + - name: Create Msi Digest + id: msi-digest + uses: sillsdev/codesign/generate-digest@v1 + with: + path: ${{ steps.find_file.outputs.fb_msi_path }} + public-cert: ${{ secrets.CODESIGN_LSDEVSECTIGOEV }} + if: github.event_name != 'pull_request' + + - name: Sign Digest + id: sign-digest + uses: sillsdev/codesign/.github/workflows/sign-digest@v1 + with: + digest: ${{ steps.msi-digest.outputs.digest }} + if: github.event_name != 'pull_request' + + - name: Build Installer Bundles + id: apply-digest + shell: pwsh + env: + signtool: C:/"Program Files (x86)"/"Windows Kits"/10/bin/10.0.17763.0/x86/signtool.exe + run: | + Set-Content -Path ${{ steps.find_file.outputs.fb_msi_path }}.dig.signed -Value '${{ steps.sign-digest.outputs.signed-digest }}' + ${{env.signtool}} sign /di . /v ${{ steps.find_file.outputs.fb_msi_path }} + if: github.event_name != 'pull_request' \ No newline at end of file diff --git a/build/WixPatchableInstaller.targets b/build/WixPatchableInstaller.targets index 4742839f..4e97783d 100644 --- a/build/WixPatchableInstaller.targets +++ b/build/WixPatchableInstaller.targets @@ -50,6 +50,9 @@ $(InstallersBaseDir)/$(SafeApplicationName)_Build_Master objects/$(SafeApplicationName) $(BinDirSuffix)_Data + $(SafeApplicationName)_$(BuildVersion).msi + $(RootDir)/src/WiXInstaller/BaseInstallerBuild + "$(ApplicationName)" $(SafeApplicationName) $(BuildVersion) $(ProductIdGuid) $(UpgradeCodeGuid) "$(AppBuildDir)/$(BinDirSuffix)" "$(AppBuildDir)/$(DataDirSuffix)" $(CopyrightYear) "$(Manufacturer)" $(SafeManufacturer) @@ -184,14 +187,35 @@ - + + + + + + + + + + + + + + + + + + - $(SafeApplicationName)_$(BuildVersion).msi - $(RootDir)/src/WiXInstaller/BaseInstallerBuild - "$(ApplicationName)" $(SafeApplicationName) $(BuildVersion) $(ProductIdGuid) $(UpgradeCodeGuid) "$(AppBuildDir)/$(BinDirSuffix)" "$(AppBuildDir)/$(DataDirSuffix)" $(CopyrightYear) "$(Manufacturer)" $(SafeManufacturer) + "$(ApplicationName)" $(SafeApplicationName) $(BuildVersion) $(ProductIdGuid) $(UpgradeCodeGuid) "$(AppBuildDir)/$(BinDirSuffix)" "$(AppBuildDir)/$(DataDirSuffix)" $(CopyrightYear) "$(Manufacturer)" $(SafeManufacturer) - + + + + + "$(ApplicationName)" $(SafeApplicationName) $(BuildVersion) $(ProductIdGuid) $(UpgradeCodeGuid) "$(AppBuildDir)/$(BinDirSuffix)" "$(AppBuildDir)/$(DataDirSuffix)" $(CopyrightYear) "$(Manufacturer)" $(SafeManufacturer) + + diff --git a/l10n/l10n.proj b/l10n/l10n.proj index cf075088..47564186 100644 --- a/l10n/l10n.proj +++ b/l10n/l10n.proj @@ -37,7 +37,7 @@ - + diff --git a/src/LibFLExBridge-ChorusPluginTests/LibFLExBridge-ChorusPluginTests.csproj b/src/LibFLExBridge-ChorusPluginTests/LibFLExBridge-ChorusPluginTests.csproj index 6f639b0c..e934f0be 100644 --- a/src/LibFLExBridge-ChorusPluginTests/LibFLExBridge-ChorusPluginTests.csproj +++ b/src/LibFLExBridge-ChorusPluginTests/LibFLExBridge-ChorusPluginTests.csproj @@ -12,7 +12,7 @@ - +