-
Notifications
You must be signed in to change notification settings - Fork 0
156 lines (133 loc) · 4.33 KB
/
build.yml
File metadata and controls
156 lines (133 loc) · 4.33 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
name: Build HyperDbg Unified Driver
on:
push:
branches:
- master
- dev
pull_request:
branches:
- master
- dev
workflow_dispatch:
schedule:
- cron: '0 */6 * * *'
env:
WDK_URL: https://go.microsoft.com/fwlink/?linkid=2196230
BUILD_DIR: ./build
CONFIG: Release
FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: true
jobs:
build-and-release:
runs-on: windows-2022
permissions:
contents: write
strategy:
matrix:
BUILD_CONFIGURATION: [Release]
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Clone HyperDbg repository
run: |
git clone --recursive -b dev https://github.com/HyperDbg/HyperDbg.git HyperDbg
- name: Apply compilation fix patch
working-directory: .
run: |
cd HyperDbg
git apply --check -p1 ../driver_compilation_fix.patch
git apply -p1 ../driver_compilation_fix.patch
- 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/setup-msbuild@v1.1
- name: Setup CMake
uses: jwlawson/actions-setup-cmake@v2
with:
cmake-version: '3.28'
- name: Create build directory
run: |
if (Test-Path $env:BUILD_DIR) {
Remove-Item -Path $env:BUILD_DIR -Recurse -Force
}
New-Item -ItemType Directory -Path $env:BUILD_DIR | Out-Null
- name: Configure CMake
working-directory: ${{env.BUILD_DIR}}
run: |
cmake -G "Visual Studio 17 2022" -A x64 -DCMAKE_BUILD_TYPE=${{matrix.BUILD_CONFIGURATION}} ..
- name: Build with CMake
working-directory: ${{env.BUILD_DIR}}
run: |
cmake --build . --config ${{matrix.BUILD_CONFIGURATION}}
- name: List build outputs
working-directory: ${{env.BUILD_DIR}}
run: |
Write-Host "=== Build Output Directory ==="
Get-ChildItem -Path ${{matrix.BUILD_CONFIGURATION}} -Recurse | Select-Object FullName, Length
- name: Upload driver artifacts
uses: actions/upload-artifact@v4
with:
name: driver_${{matrix.BUILD_CONFIGURATION}}
path: |
${{env.BUILD_DIR}}/${{matrix.BUILD_CONFIGURATION}}/*.sys
${{env.BUILD_DIR}}/${{matrix.BUILD_CONFIGURATION}}/*.pdb
- name: Create HyperDbg archive
if: matrix.BUILD_CONFIGURATION == 'Release'
working-directory: .
run: |
tar --zstd -cvf HyperDbg.tar.zst HyperDbg
- name: Upload HyperDbg archive
if: matrix.BUILD_CONFIGURATION == 'Release'
uses: actions/upload-artifact@v4
with:
name: hyperdbg_archive
path: HyperDbg.tar.zst
deploy-release:
name: Deploy Release
needs: build-and-release
runs-on: windows-2022
permissions:
contents: write
steps:
- name: Download driver artifacts
uses: actions/download-artifact@v4
with:
name: driver_Release
path: ./
- name: Download HyperDbg archive
uses: actions/download-artifact@v4
with:
name: hyperdbg_archive
path: ./
- name: Get HyperDbg commit info
id: hyperdbg_info
working-directory: HyperDbg
run: |
$commit = git rev-parse HEAD
$date = git log -1 --format=%cd --date=short
echo "commit=$commit" >> $env:GITHUB_OUTPUT
echo "date=$date" >> $env:GITHUB_OUTPUT
- name: Create Release
uses: softprops/action-gh-release@v1
with:
tag_name: latest
name: HyperDbg Unified Driver - Latest
files: |
*.sys
*.pdb
HyperDbg.tar.zst
body: |
HyperDbg Unified Driver - Latest Build
Build Configuration: Release
Build Date: ${{ steps.hyperdbg_info.outputs.date }}
HyperDbg Commit: ${{ steps.hyperdbg_info.outputs.commit }}
Unified Repo Commit: ${{ github.sha }}
This release is automatically updated with each successful build.
draft: false
prerelease: true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}