Merge pull request #396 from HyperDbg/hwdbg-script #479
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: vs2022-ci | |
on: | |
push: | |
branches: | |
- master | |
- dev | |
tags: | |
- 'v*' | |
paths-ignore: | |
- '.gitignore' | |
- '.gitattributes' | |
- '**.cmd' | |
- '**.bat' | |
- '**.md' | |
pull_request: | |
paths-ignore: | |
- '.gitignore' | |
- '.gitattributes' | |
- '**.cmd' | |
- '**.bat' | |
- '**.md' | |
env: | |
# WDK for Windows 11, version 22H2 | |
WDK_URL: https://go.microsoft.com/fwlink/?linkid=2196230 | |
# Path to the solution file relative to the root of the project. | |
SOLUTION_FILE_PATH: ./hyperdbg/hyperdbg.sln | |
RELEASE_ZIP_FILE_NAME: hyperdbg | |
BUILD_BIN_DIR: ./hyperdbg/build/bin/ | |
# Zydis library | |
# ZYDIS_REPO_PATH: hyperdbg/dependencies/zydis/ | |
# ZYDIS_SOLUTION_PATH: hyperdbg/dependencies/zydis/msvc/Zydis.sln | |
# ZYDIS_BIN_DIR: hyperdbg/libraries/zydis | |
jobs: | |
win-amd64-build: | |
runs-on: windows-2022 | |
strategy: | |
matrix: | |
BUILD_CONFIGURATION: [release, debug] | |
PLATFORM: [x64] | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
submodules: recursive | |
- name: Checkout submodules recursively | |
run: git submodule update --init --recursive --remote | |
# - name: Useful default vars | |
# run: | | |
# echo "GITHUB_WORKSPACE: $GITHUB_WORKSPACE" | |
# echo "github.workspace: ${{ github.workspace }}" | |
- name: Setup WDK version 22H2 | |
run: | | |
$wdkSetupPath = "$Env:TEMP\wdksetup.exe" | |
(New-Object Net.WebClient).DownloadFile('${{env.WDK_URL}}', $wdkSetupPath) | |
Start-Process -FilePath $wdkSetupPath -ArgumentList "/quiet" -NoNewWindow -Wait | |
- name: Add MSBuild to PATH | |
uses: microsoft/[email protected] | |
# - name: Build third-party dependencies (Release Mode) | |
# working-directory: ${{env.GITHUB_WORKSPACE}} | |
# run: msbuild /m /p:Configuration="Release MT" /p:Platform=${{matrix.PLATFORM}} /target:zydis /target:zycore /p:OutDir=${{ github.workspace }}/hyperdbg/libraries/zydis/ ${{ github.workspace }}/hyperdbg/dependencies/zydis/msvc/Zydis.sln | |
- name: Build Hyperdbg solution | |
working-directory: ${{env.GITHUB_WORKSPACE}} | |
run: msbuild /m /p:Configuration=${{matrix.BUILD_CONFIGURATION}} /p:Platform=${{matrix.PLATFORM}} ${{env.SOLUTION_FILE_PATH}} | |
- name: Upload build directory | |
uses: actions/upload-artifact@v3 | |
with: | |
name: build_files_${{matrix.BUILD_CONFIGURATION}} | |
path: ${{ env.BUILD_BIN_DIR }} | |
deploy-release: | |
name: Deploy release | |
needs: win-amd64-build | |
runs-on: windows-2019 | |
if: startsWith(github.ref, 'refs/tags/') | |
steps: | |
- name: Download build files from "build" job | |
uses: actions/download-artifact@v3 | |
with: | |
name: build_files_release | |
path: ${{ env.BUILD_BIN_DIR }} | |
- name: Archive release | |
uses: thedoctor0/zip-release@master | |
with: | |
path: ${{ env.BUILD_BIN_DIR }}release/ | |
type: 'zip' | |
filename: ${{env.RELEASE_ZIP_FILE_NAME}}-${{ github.ref_name }}.zip | |
- name: Release | |
uses: softprops/action-gh-release@v1 | |
if: startsWith(github.ref, 'refs/tags/') | |
with: | |
files: | | |
${{env.RELEASE_ZIP_FILE_NAME}}-${{ github.ref_name }}.zip | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |