Skip to content

Commit

Permalink
Build libwdi
Browse files Browse the repository at this point in the history
  • Loading branch information
fixstars-sonali committed Oct 27, 2023
1 parent e44244e commit 4606b90
Showing 1 changed file with 48 additions and 1 deletion.
49 changes: 48 additions & 1 deletion .github/workflows/develop-MSVC.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,18 +13,65 @@ on:
env:
WDK_8_PKG_URL: "https://go.microsoft.com/fwlink/p/?LinkID=253170"
USB_DRIVER_INSTALLER: "https://github.com/pbatard/libwdi/releases/download/v1.5.0/zadig-2.8.exe"
WDK_URL: https://go.microsoft.com/fwlink/p/?LinkID=253170
LIBUSB0_URL: https://sourceforge.net/projects/libusb-win32/files/libusb-win32-releases/1.2.7.3/libusb-win32-bin-1.2.7.3.zip/download
LIBUSBK_URL: https://github.com/mcuee/libusbk/releases/download/V3.1.0.0/libusbK-3.1.0.0-bin.7z
SOLUTION_FILE_PATH: ./libwdi.sln
BUILD_MACROS: '"WDK_DIR=\"../wdk/Windows Kits/8.0\";LIBUSB0_DIR=\"../libusb0\";LIBUSBK_DIR=\"../libusbk/bin\""'
jobs:
release:
runs-on: windows-latest

steps:
- name: Checkout
uses: actions/checkout@v4.1.1
with:
repository: https://github.com/pbatard/libwdi.git
ref: "v1.5.0"
submodules: recursive

- name: Download support files
working-directory: libwdi
shell: cmd
run: |
curl -L ${{ env.WDK_URL }} -o wdk-redist.msi
curl -L ${{ env.LIBUSB0_URL }} -o libusb0-redist.zip
curl -L ${{ env.LIBUSBK_URL }} -o libusbk-redist.7z
msiexec /a wdk-redist.msi /qn TARGETDIR=%CD%\wdk
7z x libusb0-redist.zip
7z x libusbk-redist.7z
del *.zip
del *.7z
move libusb-win32* libusb0
move libusbK* libusbk
- name: Add MSBuild to PATH
uses: microsoft/setup-msbuild@v1

- name: Build
working-directory: libwdi
shell: cmd
run: |
for %%P in (Win32 x64) do (
for %%B in (Debug Release) do (
msbuild ${{ env.SOLUTION_FILE_PATH }} /m /p:Configuration=%%B,Platform=%%P,BuildMacros=${{ env.BUILD_MACROS }}
)
)
- name: Upload artifacts
uses: actions/upload-artifact@v3
if: ${{ github.event_name == 'push' }}
with:
name: VS2022
path: ./*/*/examples/*.exe

- name: Download USB driver and install component
run: |
Invoke-WebRequest -Uri ${{ env.USB_DRIVER_INSTALLER }} -OutFile zadig-2.8.exe
zadig-2.8.exe
- name: Checkout repository and submodules
uses: actions/checkout@v2
uses: actions/checkout@v4.1.1
with:
submodules: recursive

Expand Down

0 comments on commit 4606b90

Please sign in to comment.