-
Notifications
You must be signed in to change notification settings - Fork 49
85 lines (72 loc) · 2.41 KB
/
build.yml
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
on:
pull_request:
push:
branches:
- main
tags:
- v*
jobs:
build:
runs-on: windows-2022
strategy:
matrix:
arch: [ x64, Win32 ]
build_type: [ Debug, Release ]
steps:
- name: Checkout
uses: actions/checkout@v4.1.1
- name: Configure
run: |
mkdir build
cd build
cmake -A ${{matrix.arch}} -DCMAKE_BUILD_TYPE=${{matrix.build_type}} -DSAFETYHOOK_FETCH_ZYDIS=ON -DSAFETYHOOK_BUILD_EXAMPLES=ON -DSAFETYHOOK_BUILD_TEST=ON -DSAFETYHOOK_AMALGAMATE=ON ..
- name: Build
run: |
cmake --build build --config ${{matrix.build_type}} --parallel
- name: Test
run: |
./build/${{matrix.build_type}}/test.exe
./build/${{matrix.build_type}}/test-amalgamated.exe
amalgamated-dist:
runs-on: windows-2022
needs: build
steps:
- name: Checkout
uses: actions/checkout@v4.1.1
- name: Amalgamate
run: |
python3 amalgamate.py
- name: Compress amalgamated release
uses: vimtor/action-zip@v1.1
with:
files: amalgamated-dist/
dest: safetyhook-amalgamated.zip
- name: Upload amalgamate
uses: actions/upload-artifact@v4.3.0
with:
name: safetyhook-amalgamated
path: amalgamated-dist/
- name: Download & extract Zydis
run: |
Invoke-WebRequest -Uri https://github.com/zyantific/zydis/releases/download/v4.0.0/zydis-amalgamated.zip -OutFile zydis.zip
Expand-Archive .\zydis.zip .
Remove-Item .\zydis.zip
@("#define ZYCORE_STATIC_BUILD", "#define ZYDIS_STATIC_BUILD") + (Get-Content -Raw .\amalgamated-dist\Zydis.h) | Set-Content -Encoding utf8 .\amalgamated-dist\Zydis.h
- name: Compress amalgamated release with Zydis
uses: vimtor/action-zip@v1.1
with:
files: amalgamated-dist/
dest: safetyhook-amalgamated-zydis.zip
- name: Upload amalgamate with Zydis
uses: actions/upload-artifact@v4.3.0
with:
name: safetyhook-amalgamated-zydis
path: amalgamated-dist/
- name: Release
uses: softprops/action-gh-release@v0.1.15
if: startsWith(github.ref, 'refs/tags/')
with:
prerelease: ${{contains(github.ref, '-pre')}}
files: |
safetyhook-amalgamated.zip
safetyhook-amalgamated-zydis.zip