-
Notifications
You must be signed in to change notification settings - Fork 2
79 lines (63 loc) · 2.53 KB
/
reassemble.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
name: Reassemble
on: [push, pull_request]
jobs:
reassemble:
strategy:
fail-fast: false
matrix:
os: [ubuntu, windows]
runs-on: ${{ matrix.os }}-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.12'
- name: Install Python dependencies
run: pip install -r src/scripts/requirements.txt
- name: Install Ninja
uses: seanmiddleditch/gha-setup-ninja@master
- name: Download lld and clang
uses: robinraju/release-downloader@v1
with:
repository: 'openblack/llvm-project'
tag: 'bw1-decomp-002'
fileName: 'llvm-${{ matrix.os }}.zip'
extract: true
out-file-path: 'llvm'
- name: Ensure LLVM binaries are executable
if: ${{ runner.os != 'Windows' }}
run: chmod -R +x llvm/bin
- name: Build bw1-decomp project
run: |
cmake -Ssrc -Bbuild -G Ninja -DCMAKE_BUILD_TYPE=Release -DCMAKE_LINKER="${{ github.workspace }}/llvm/bin/lld${{ runner.os == 'Windows' && '.exe' || '' }}" -DCMAKE_ASM_COMPILER="${{ github.workspace }}/llvm/bin/clang${{ runner.os == 'Windows' && '.exe' || '' }}"
cmake --build build
- name: Verify MD5 sum of resulting binary
run: |
expected_md5="174b1a64e74b2321f3c38ccc8a511e78"
actual_md5=$(md5sum "${{ github.workspace }}/build/runblack-reassembled.exe" | awk '{ print $1 }' | sed 's/^\\//')
if [ "$expected_md5" != "$actual_md5" ]; then
echo "Error: MD5 sum mismatch. Expected $expected_md5 but got $actual_md5"
exit 1
else
echo "MD5 sum matches: $actual_md5"
fi
shell: bash
- name: Upload binary if MD5 sum mismatch
if: failure()
uses: actions/upload-artifact@v4
with:
name: failed-binary-${{ matrix.os }}
path: build/runblack-reassembled.exe
- name: Build bw1-decomp project (Debug)
run: |
cmake -Ssrc -Bbuild_debug -G Ninja -DCMAKE_BUILD_TYPE=RelWithDebInfo -DCMAKE_LINKER="${{ github.workspace }}/llvm/bin/lld${{ runner.os == 'Windows' && '.exe' || '' }}" -DCMAKE_ASM_COMPILER="${{ github.workspace }}/llvm/bin/clang${{ runner.os == 'Windows' && '.exe' || '' }}"
cmake --build build_debug
- name: Upload debug version
uses: actions/upload-artifact@v4
with:
name: debug-binary-${{ matrix.os }}
path: |
build_debug/runblack-reassembled.exe
build_debug/runblack-reassembled.exe.pdb