forked from signal11/hidapi
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Windows build artifacts with Github Actions (signal11#414)
- a straight-forward build matrix for Appveyor; - MSBuild builds with Github Actions; - Visual Studio 2022 support for `.sln` (toolset v143); - gather Windows build artifacts with Github actions;
- Loading branch information
Showing
4 changed files
with
87 additions
and
56 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -95,72 +95,99 @@ jobs: | |
install/static/include/hidapi/hidapi_libusb.h" | ||
allow_failure: true | ||
|
||
windows-cmake-msvc: | ||
windows-cmake: | ||
|
||
runs-on: windows-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
with: | ||
path: hidapisrc | ||
- name: Configure CMake | ||
- name: Configure CMake MSVC | ||
shell: cmd | ||
run: | | ||
RMDIR /Q /S build install | ||
cmake -B build -S hidapisrc -DCMAKE_INSTALL_PREFIX=install -DHIDAPI_BUILD_HIDTEST=ON "-DCMAKE_C_FLAGS=%MSVC_COMPILE_FLAGS%" | ||
- name: Build CMake | ||
working-directory: build | ||
cmake -B build\msvc -S hidapisrc -DCMAKE_INSTALL_PREFIX=install\msvc -DHIDAPI_BUILD_HIDTEST=ON "-DCMAKE_C_FLAGS=%MSVC_COMPILE_FLAGS%" | ||
- name: Build CMake MSVC | ||
working-directory: build/msvc | ||
run: cmake --build . --target install | ||
- name: Check artifacts | ||
- name: Check artifacts MSVC | ||
uses: andstor/file-existence-action@v1 | ||
with: | ||
files: "install/lib/hidapi.lib, install/bin/hidapi.dll, install/include/hidapi/hidapi.h, install/include/hidapi/hidapi_winapi.h" | ||
files: "install/msvc/lib/hidapi.lib, \ | ||
install/msvc/bin/hidapi.dll, \ | ||
install/msvc/include/hidapi/hidapi.h, \ | ||
install/msvc/include/hidapi/hidapi_winapi.h" | ||
allow_failure: true | ||
|
||
windows-cmake-nmake: | ||
|
||
runs-on: windows-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
with: | ||
path: hidapisrc | ||
- name: Configure CMake | ||
- name: Configure CMake NMake | ||
shell: cmd | ||
run: | | ||
RMDIR /Q /S build install | ||
call "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build\vcvars64.bat" | ||
cmake -G"NMake Makefiles" -B build -S hidapisrc -DCMAKE_INSTALL_PREFIX=install -DHIDAPI_BUILD_HIDTEST=ON "-DCMAKE_C_FLAGS=%MSVC_COMPILE_FLAGS%" | ||
- name: Build CMake | ||
working-directory: build | ||
cmake -G"NMake Makefiles" -B build\nmake -S hidapisrc -DCMAKE_INSTALL_PREFIX=install\nmake -DHIDAPI_BUILD_HIDTEST=ON "-DCMAKE_C_FLAGS=%MSVC_COMPILE_FLAGS%" | ||
- name: Build CMake NMake | ||
working-directory: build\nmake | ||
shell: cmd | ||
run: | | ||
call "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build\vcvars64.bat" | ||
nmake install | ||
- name: Check artifacts | ||
- name: Check artifacts NMake | ||
uses: andstor/file-existence-action@v1 | ||
with: | ||
files: "install/nmake/lib/hidapi.lib, \ | ||
install/nmake/bin/hidapi.dll, \ | ||
install/nmake/include/hidapi/hidapi.h, \ | ||
install/nmake/include/hidapi/hidapi_winapi.h" | ||
allow_failure: true | ||
|
||
- name: Configure CMake MinGW | ||
shell: cmd | ||
run: | | ||
cmake -G"MinGW Makefiles" -B build\mingw -S hidapisrc -DCMAKE_INSTALL_PREFIX=install\mingw -DHIDAPI_BUILD_HIDTEST=ON "-DCMAKE_C_FLAGS=%NIX_COMPILE_FLAGS%" | ||
- name: Build CMake MinGW | ||
working-directory: build\mingw | ||
run: cmake --build . --target install | ||
- name: Check artifacts MinGW | ||
uses: andstor/file-existence-action@v1 | ||
with: | ||
files: "install/lib/hidapi.lib, install/bin/hidapi.dll, install/include/hidapi/hidapi.h, install/include/hidapi/hidapi_winapi.h" | ||
files: "install/mingw/lib/libhidapi.dll.a, \ | ||
install/mingw/bin/libhidapi.dll, \ | ||
install/mingw/include/hidapi/hidapi.h, \ | ||
install/mingw/include/hidapi/hidapi_winapi.h" | ||
allow_failure: true | ||
|
||
windows-cmake-mingw: | ||
windows-msbuild: | ||
|
||
runs-on: windows-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: microsoft/[email protected] | ||
- name: MSBuild x86 | ||
run: msbuild windows\hidapi.sln /p:Configuration=Release /p:Platform=Win32 | ||
- name: Check artifacts x86 | ||
uses: andstor/file-existence-action@v1 | ||
with: | ||
path: hidapisrc | ||
- name: Configure CMake | ||
shell: cmd | ||
run: | | ||
RMDIR /Q /S build install | ||
cmake -G"MinGW Makefiles" -B build -S hidapisrc -DCMAKE_INSTALL_PREFIX=install -DHIDAPI_BUILD_HIDTEST=ON "-DCMAKE_C_FLAGS=%NIX_COMPILE_FLAGS%" | ||
- name: Build CMake | ||
working-directory: build | ||
run: cmake --build . --target install | ||
- name: Check artifacts | ||
files: "windows/Release/hidapi.dll, windows/Release/hidapi.lib, windows/Release/hidapi.pdb" | ||
allow_failure: true | ||
- name: MSBuild x64 | ||
run: msbuild windows\hidapi.sln /p:Configuration=Release /p:Platform=x64 | ||
- name: Check artifacts x64 | ||
uses: andstor/file-existence-action@v1 | ||
with: | ||
files: "install/lib/libhidapi.dll.a, install/bin/libhidapi.dll, install/include/hidapi/hidapi.h, install/include/hidapi/hidapi_winapi.h" | ||
files: "windows/x64/Release/hidapi.dll, windows/x64/Release/hidapi.lib, windows/x64/Release/hidapi.pdb" | ||
allow_failure: true | ||
- name: Gather artifacts | ||
run: | | ||
md artifacts | ||
md artifacts\x86 | ||
md artifacts\x64 | ||
md artifacts\include | ||
Copy-Item "windows\Release\hidapi.dll","windows\Release\hidapi.lib","windows\Release\hidapi.pdb" -Destination "artifacts\x86" | ||
Copy-Item "windows\x64\Release\hidapi.dll","windows\x64\Release\hidapi.lib","windows\x64\Release\hidapi.pdb" -Destination "artifacts\x64" | ||
Copy-Item "hidapi\hidapi.h","windows\hidapi_winapi.h" -Destination "artifacts\include" | ||
- name: Upload artifacts | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: hidapi-win | ||
path: artifacts/ | ||
retention-days: ${{ (github.event_name == 'pull_request' || github.ref_name != 'master') && 7 || 90 }} |
This file contains 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
This file contains 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