Skip to content

Commit

Permalink
Add tools c build support
Browse files Browse the repository at this point in the history
  • Loading branch information
vinxue committed Nov 11, 2024
1 parent 35aeb69 commit 7990bcb
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions .github/workflows/msbuild.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ env:
SOLUTION_FILE_PATH_IMGCONVERTER: ImgConverter
SOLUTION_FILE_PATH_STOPWATCH: StopWatch
SOLUTION_FILE_PATH_IDCARD: IDCard
TOOLS_C_PATH: Tools/C

# Configuration type to build.
# You can convert this to a build matrix if you need coverage of multiple configuration types.
Expand All @@ -39,8 +40,16 @@ jobs:
steps:
- uses: actions/checkout@v4

- name: Add MSBuild to PATH
uses: microsoft/setup-msbuild@v2
- name: Set up and Add Visual Studio to PATH
# Use vswhere to find the latest version of Visual Studio
# Add Visual Studio to PATH
run: |
set VSWHERE="%ProgramFiles(x86)%\Microsoft Visual Studio\Installer\vswhere.exe"
for /f "usebackq tokens=*" %%i in (`%VSWHERE% -latest -products * -requires Microsoft.VisualStudio.Component.VC.Tools.x86.x64 -property installationPath`) do (set InstallDir=%%i)
echo VS Installation Path: %InstallDir%
call "%InstallDir%\VC\Auxiliary\Build\vcvarsall.bat" x64
shell: cmd

- name: Build
working-directory: ${{env.GITHUB_WORKSPACE}}
Expand All @@ -54,6 +63,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}}
cl /EHsc ${{env.TOOLS_C_PATH}}/Crc.c
- name: Upload Artifact
uses: actions/upload-artifact@v4
Expand All @@ -66,3 +76,4 @@ jobs:
${{env.SOLUTION_FILE_PATH_TIMER}}/Release/*.exe
${{env.SOLUTION_FILE_PATH_IMGCONVERTER}}/Release/*.exe
${{env.SOLUTION_FILE_PATH_STOPWATCH}}/Release/*.exe
${{env.TOOLS_C_PATH}}/*.exe

0 comments on commit 7990bcb

Please sign in to comment.