Use powershell to download #6
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
name: WinUSB installer Build, Test | |
on: | |
push: | |
branches: | |
- 'features/2-cdci-create-gitlab-workflow' #'*' # This will run the build and test jobs for pull requests to all branches | |
# pull_request: | |
# branches: | |
# - '*' # This will run the build and test jobs for pull requests to all branches | |
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: pbatard/libwdi.git | |
ref: "v1.5.0" | |
submodules: recursive | |
- name: Download support files | |
working-directory: libwdi | |
run: | | |
Invoke-WebRequest -Uri ${{ env.WDK_URL }} -OutFile wdk-redist.msi | |
Invoke-WebRequest -Uri${{ env.LIBUSB0_URL }} -OutFile libusb0-redist.zip | |
Invoke-WebRequest -Uri ${{ env.LIBUSBK_URL }} -OutFile libusbk-redist.7z | |
- name: Install support files | |
working-directory: libwdi | |
shell: cmd | |
run: | | |
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@v4.1.1 | |
with: | |
submodules: recursive | |
- name: Create and enter the build directory | |
run: | | |
mkdir build | |
cd build | |
- name: Download WDK 8 and install component | |
run: | | |
Invoke-WebRequest -Uri ${{ env.WDK_8_PKG_URL }} -OutFile wdfcoinstaller.msi | |
msiexec /i wdfcoinstaller.msi /qn /l*v install.log | |