Introduce Base build CD action #14
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Base Installer | |
| on: | |
| push: | |
| branches: ["release/9.3", "feature/gha-cd"] | |
| workflow_dispatch: | |
| inputs: | |
| fw_ref: | |
| description: 'Commit-ish (branch, tag, SHA) to checkout for the main repository' | |
| required: false | |
| default: '' | |
| helps_ref: | |
| description: 'Commit-ish for helps repository' | |
| required: false | |
| default: 'develop' | |
| installer_ref: | |
| description: 'Commit-ish for PatchableInstaller repository' | |
| required: false | |
| default: 'master' | |
| localizations_ref: | |
| description: 'Commit-ish for localization repository' | |
| required: false | |
| default: 'develop' | |
| lcm_ref: | |
| description: 'Commit-ish for liblcm repository' | |
| required: false | |
| default: 'master' | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} | |
| cancel-in-progress: true | |
| jobs: | |
| debug_build_and_test: | |
| env: | |
| CROWDIN_API_KEY: ${{ secrets.FLEX_CROWDIN_API }} | |
| LcmRootDir: ${{ github.workspace }}/Localizations/LCM | |
| FILESTOSIGNLATER: ./signExternally | |
| name: Build Debug and run Tests | |
| runs-on: windows-latest | |
| steps: | |
| - name: Checkout Files | |
| uses: actions/checkout@v4 | |
| id: checkout | |
| with: | |
| ref: ${{ github.event.inputs.fw_ref || github.ref }} | |
| fetch-depth: 0 | |
| - name: Checkout Helps | |
| uses: actions/checkout@v4 | |
| id: helps-checkout | |
| with: | |
| repository: 'sillsdev/FwHelps' | |
| ref: ${{ github.event.inputs.helps_ref || 'develop' }} | |
| fetch-depth: 0 | |
| path: 'DistFiles/Helps' | |
| - name: Checkout PatchableInstaller | |
| uses: actions/checkout@v4 | |
| id: installer-checkout | |
| with: | |
| repository: 'sillsdev/genericinstaller' | |
| ref: ${{ github.event.inputs.installer_ref || 'master' }} | |
| fetch-depth: 0 | |
| path: 'PatchableInstaller' | |
| - name: Checkout Localizations | |
| uses: actions/checkout@v4 | |
| id: loc-checkout | |
| with: | |
| repository: 'sillsdev/FwLocalizations' | |
| ref: ${{ github.event.inputs.localizations_ref || 'develop' }} | |
| fetch-depth: 0 | |
| path: 'Localizations' | |
| - name: Checkout liblcm | |
| uses: actions/checkout@v4 | |
| id: liblcm-checkout | |
| with: | |
| repository: 'sillsdev/liblcm' | |
| ref: ${{ github.event.inputs.installer_ref || 'master' }} | |
| fetch-depth: 0 | |
| path: 'Localizations/LCM' | |
| - name: Download 461 targeting pack | |
| uses: suisei-cn/actions-download-file@818d6b7dc8fe73f2f924b6241f2b1134ca1377d9 # 1.6.0 | |
| id: downloadfile # Remember to give an ID if you need the output filename | |
| with: | |
| url: "https://download.microsoft.com/download/F/1/D/F1DEB8DB-D277-4EF9-9F48-3A65D4D8F965/NDP461-DevPack-KB3105179-ENU.exe" | |
| target: public/ | |
| - name: Install targeting pack | |
| shell: cmd | |
| working-directory: public | |
| run: NDP461-DevPack-KB3105179-ENU.exe /q | |
| - name: Setup dotnet | |
| uses: actions/setup-dotnet@v4 | |
| with: | |
| dotnet-version: | | |
| 3.1.x | |
| 5.0.x | |
| - name: Install Overcrowdin | |
| shell: cmd | |
| run: | | |
| dotnet tool update -g overcrowdin || dotnet tool install -g overcrowdin | |
| - 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 | |
| if: github.event_name != 'pull_request' | |
| - name: Prepare for build | |
| shell: cmd | |
| working-directory: Build | |
| run: build64.bat /t:WriteNonlocalDevelopmentPropertiesFile | |
| - name: Build Debug and run tests | |
| id: build_installer | |
| shell: powershell | |
| run: | | |
| cd Build | |
| .\build64.bat /t:BuildBaseInstaller "/property:config=release;action=test;desktopNotAvailable=true" /v:d /bl ^| tee-object -FilePath build.log | |
| cd .. | |
| cd BuildDir | |
| md5sum *.exe > md5.txt | |
| - name: Scan Debug Build Output | |
| shell: powershell | |
| working-directory: Build | |
| run: | | |
| $results = Select-String -Path "build.log" -Pattern "^\s*[1-9][0-9]* Error\(s\)" | |
| if ($results) { | |
| foreach ($result in $results) { | |
| Write-Host "Found errors in build.log $($result.LineNumber): $($result.Line)" -ForegroundColor red | |
| } | |
| exit 1 | |
| } else { | |
| Write-Host "No errors found" -ForegroundColor green | |
| exit 0 | |
| } | |
| - name: Find the versioned installer bundles | |
| id: find_bundles | |
| shell: pwsh | |
| working-directory: BuildDir | |
| run: | | |
| Get-ChildItem -Path . | |
| $offlineExe = Get-ChildItem -Path . -Filter "FieldWorks_*_Offline_x64.exe" | Select-Object -First 1 | |
| $onlineExe = Get-ChildItem -Path . -Filter "FieldWorks_*_Online_x64.exe" | Select-Object -First 1 | |
| if (-not $offlineExe) { throw "FieldWorks_VERSION_Offline_x64.exe not found in BuildDir" } | |
| if (-not $onlineExe) { throw "FieldWorks_VERSION_Online_x64.exe not found in BuildDir" } | |
| echo "offline_exe=$($offlineExe.FullName)" >> $GITHUB_OUTPUT | |
| echo "online_exe=$($onlineExe.FullName)" >> $GITHUB_OUTPUT | |
| - name: Extract burn engines from bundles | |
| shell: cmd | |
| working-directory: BuildDir | |
| run: | | |
| insignia -input "${{ steps.find_bundles.outputs.offline_exe }}" -output offline-engine.exe | |
| insignia -input "${{ steps.find_bundles.outputs.online_exe }}" -output online-engine.exe | |
| - name: Sign Engines | |
| if: github.event_name != 'pull_request' | |
| uses: sillsdev/codesign/trusted-signing-action@v3 | |
| with: | |
| credentials: ${{ secrets.TRUSTED_SIGNING_CREDENTIALS }} | |
| files-folder: BuildDir | |
| files-folder-filter: '*-engine.exe' | |
| description: 'FieldWorks Installer' | |
| description-url: 'https://software.sil.org/fieldworks/' | |
| - name: Reattach Engines | |
| if: github.event_name != 'pull_request' | |
| working-directory: BuildDir | |
| shell: cmd | |
| run: | | |
| insignia -ab online-engine.exe "${{ steps.find_bundles.outputs.offline_exe }}" -o "${{ steps.find_bundles.outputs.offline_exe }}" | |
| insignia -ab offline-engine.exe "${{ steps.find_bundles.outputs.offline_exe }}" -o "${{ steps.find_bundles.outputs.offline_exe }}" | |
| - name: Sign Bundles | |
| if: github.event_name != 'pull_request' | |
| uses: sillsdev/codesign/trusted-signing-action@v3 | |
| with: | |
| credentials: ${{ secrets.TRUSTED_SIGNING_CREDENTIALS }} | |
| files-folder: BuildDir | |
| files-folder-filter: FieldWorks_*.exe | |
| description: 'FieldWorks Installer' | |
| description-url: 'https://software.sil.org/fieldworks/' | |
| - name: Upload Signed Installers | |
| uses: actions/upload-artifact@v4 | |
| if: github.event_name != 'pull_request' | |
| with: | |
| name: FieldWorks-Installers | |
| path: BuildDir/FieldWorks_*.exe | |
| if-no-files-found: warn | |
| - name: Upload Build Logs | |
| uses: actions/upload-artifact@v4 | |
| if: always() | |
| with: | |
| name: build-logs | |
| path: | | |
| Build/*.log | |
| Build/*.binlog |