diff --git a/.github/workflows/msbuild.yml b/.github/workflows/msbuild.yml index 4c0fc26..7de963a 100644 --- a/.github/workflows/msbuild.yml +++ b/.github/workflows/msbuild.yml @@ -39,14 +39,24 @@ jobs: steps: - uses: actions/checkout@v4 - - name: Add MSBuild to PATH - uses: microsoft/setup-msbuild@v2 + - name: Set up Visual Studio + run: | + # Use vswhere to find the latest version of Visual Studio + $vswhere = "${env:ProgramFiles(x86)}\Microsoft Visual Studio\Installer\vswhere.exe" + $vsInstallationPath = & $vswhere -latest -products * -requires Microsoft.VisualStudio.Component.VC.Tools.x86.x64 -property installationPath + echo "VS Installation Path: $vsInstallationPath" + + # Add Visual Studio to ENV + $vcvars = "$vsInstallationPath\VC\Auxiliary\Build\vcvars64.bat" + echo "VCVARS=$vcvars" >> $env:GITHUB_ENV - name: Build working-directory: ${{env.GITHUB_WORKSPACE}} # Add additional options to the MSBuild command line here (like platform or verbosity level). # See https://docs.microsoft.com/visualstudio/msbuild/msbuild-command-line-reference run: | + echo "%VCVARS%" + call "%VCVARS%" msbuild /m /p:Configuration=${{env.BUILD_CONFIGURATION}} ${{env.SOLUTION_FILE_PATH_PCIE}} msbuild /m /p:Configuration=${{env.BUILD_CONFIGURATION}} ${{env.SOLUTION_FILE_PATH_BITVIEWER}} msbuild /m /p:Configuration=${{env.BUILD_CONFIGURATION}} ${{env.SOLUTION_FILE_PATH_KBSIM}} @@ -54,6 +64,7 @@ jobs: msbuild /m /p:Configuration=${{env.BUILD_CONFIGURATION}} ${{env.SOLUTION_FILE_PATH_IMGCONVERTER}} msbuild /m /p:Configuration=${{env.BUILD_CONFIGURATION}} ${{env.SOLUTION_FILE_PATH_STOPWATCH}} msbuild /m /p:Configuration=${{env.BUILD_CONFIGURATION}} ${{env.SOLUTION_FILE_PATH_IDCARD}} + shell: cmd - name: Upload Artifact uses: actions/upload-artifact@v4