Firmware makefile cleanups (#440) #205
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: Build Windows | |
| permissions: | |
| contents: read | |
| pull-requests: write | |
| on: | |
| workflow_dispatch: | |
| workflow_call: | |
| push: | |
| branches: | |
| - master | |
| - main | |
| pull_request: | |
| branches: | |
| - master | |
| - main | |
| env: | |
| # NOTE: secrets are only provided in original repo, ideal for conditional logic in forks | |
| # AI = AdvancedInstaller | |
| # ToDo: Chris, please create new secret WINDOWS_AdvancedInstaller_KEY with content of current AI_KEY | |
| #WINDOWS_AdvancedInstaller_KEY: ${{ secrets.WINDOWS_AdvancedInstaller_KEY }} | |
| WINDOWS_AdvancedInstaller_KEY: ${{ secrets.AI_KEY }} | |
| jobs: | |
| build-windows: | |
| runs-on: windows-2022 | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| include: | |
| - qt_arch: 'win64_msvc2019_64' | |
| platform: 'x64' | |
| output_bin_dir: 'bin64' | |
| - qt_arch: 'win32_msvc2019' | |
| platform: 'x86' | |
| output_bin_dir: 'bin32' | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| with: | |
| submodules: 'recursive' | |
| - name: Install eigen | |
| shell: cmd | |
| run: | | |
| choco install eigen | |
| - name: Install Qt | |
| uses: jurplel/install-qt-action@v4 | |
| with: | |
| aqtversion: '==3.1.*' | |
| version: '5.15.2' | |
| host: 'windows' | |
| target: 'desktop' | |
| arch: '${{ matrix.qt_arch }}' | |
| - name: Setup MSVC Developer Command Prompt | |
| uses: ilammy/msvc-dev-cmd@v1 | |
| with: | |
| arch: ${{ matrix.platform }} | |
| toolset: 14.2 | |
| - name: Build librador | |
| if: matrix.platform == 'x64' | |
| working-directory: Librador_API/___librador/librador | |
| run: | | |
| qmake -config release | |
| nmake | |
| - name: Build librademo | |
| if: matrix.platform == 'x64' | |
| working-directory: Librador_API/___librador/librademo | |
| run: | | |
| qmake -config release | |
| nmake | |
| - name: Build basicdemo | |
| if: matrix.platform == 'x64' | |
| working-directory: Librador_API/___librador/basicdemo | |
| run: | | |
| qmake -config release | |
| nmake | |
| - name: Build Labrador | |
| working-directory: Desktop_Interface | |
| shell: cmd | |
| run: | | |
| qmake -config release INCLUDEPATH+="C:\ProgramData\chocolatey\lib\eigen\include\eigen3" | |
| nmake | |
| nmake INSTALL_ROOT=bin install | |
| windeployqt bin\Labrador.exe | |
| - name: Upload artifacts | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: ${{ matrix.output_bin_dir }} | |
| path: Desktop_Interface/bin | |
| build-installer: | |
| needs: | |
| - build-windows | |
| runs-on: windows-2022 | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| with: | |
| sparse-checkout: Desktop_Interface/build_win | |
| - name: Download artifacts | |
| uses: actions/download-artifact@v4 | |
| with: | |
| pattern: bin* | |
| - name: Download additional files | |
| shell: pwsh | |
| run: | | |
| Invoke-WebRequest -Uri "http://espotek.com/ai167.msi" -OutFile "ai167.msi" | |
| mkdir "Prerequisites/Visual C++ Redistributable for Visual Studio 2015-2019" | |
| Invoke-WebRequest -Uri "https://download.visualstudio.microsoft.com/download/pr/9307e627-aaac-42cb-a32a-a39e166ee8cb/E59AE3E886BD4571A811FE31A47959AE5C40D87C583F786816C60440252CD7EC/VC_redist.x86.exe" -OutFile "Prerequisites/Visual C++ Redistributable for Visual Studio 2015-2019/VC_redist.x86.exe" | |
| Invoke-WebRequest -Uri "https://download.visualstudio.microsoft.com/download/pr/3b070396-b7fb-4eee-aa8b-102a23c3e4f4/40EA2955391C9EAE3E35619C4C24B5AAF3D17AEAA6D09424EE9672AA9372AEED/VC_redist.x64.exe" -OutFile "Prerequisites/Visual C++ Redistributable for Visual Studio 2015-2019/VC_redist.x64.exe" | |
| - name: Install Advanced Installer | |
| shell: cmd | |
| run: | | |
| msiexec /i ai167.msi /qn | |
| del ai167.msi | |
| - name: Register Advanced Installer | |
| if: env.WINDOWS_AdvancedInstaller_KEY != '' | |
| shell: cmd | |
| run: | | |
| "C:/Program Files (x86)/Caphyon/Advanced Installer 16.7/bin/x86/AdvancedInstaller.com" /register %WINDOWS_AdvancedInstaller_KEY% | |
| - name: Build installer | |
| shell: cmd | |
| env: | |
| PACKAGE_VERSION: "1.0.${{ github.run_number }}" | |
| run: | | |
| move Desktop_Interface\build_win\Labrador.aip . | |
| move Desktop_Interface\build_win\driver . | |
| rmdir /s /q Desktop_Interface | |
| for /f "delims=" %%i in ('git rev-parse --short HEAD') do set GIT_HASH_SHORT=%%i | |
| "C:\Program Files (x86)\Caphyon\Advanced Installer 16.7\bin\x86\AdvancedInstaller.com" /edit Labrador.aip /SetPackageName Labrador-%GIT_HASH_SHORT%-installer.exe | |
| "C:\Program Files (x86)\Caphyon\Advanced Installer 16.7\bin\x86\AdvancedInstaller.com" /edit Labrador.aip /SetVersion %PACKAGE_VERSION% | |
| "C:\Program Files (x86)\Caphyon\Advanced Installer 16.7\bin\x86\AdvancedInstaller.com" /rebuild Labrador.aip | |
| - name: Upload artifacts | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: asset-exe-installer | |
| path: Labrador-SetupFiles/Labrador*.exe | |
| compression-level: 0 | |
| if-no-files-found: error |