-
Notifications
You must be signed in to change notification settings - Fork 50
208 lines (204 loc) · 6.31 KB
/
ci.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
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
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
name: r2dec CI
on:
push:
branches:
- master
pull_request:
branches:
- master
# Automatically cancel any previous workflow on new push.
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}-${{ github.event_name }}
cancel-in-progress: true
env:
R2V: 5.9.2
jobs:
sources:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: 3.7.x
- name: apt dependencies
run: sudo pip3 install meson ninja
- name: fetch dependencies via meson
run: meson subprojects download
- uses: actions/upload-artifact@v4
with:
name: r2dec-${{env.R2V}}-src-with-deps.zip
path: |
.
!.git/
!.github/
!.ci-scripts/
!subprojects/libquickjs/.git/
linux:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: 3.7.x
- name: apt dependencies
run: sudo pip3 install meson ninja
- name: install r2
run: |
wget -q https://github.com/radareorg/radare2/releases/download/${R2V}/radare2_${R2V}_amd64.deb
wget -q https://github.com/radareorg/radare2/releases/download/${R2V}/radare2-dev_${R2V}_amd64.deb
sudo dpkg -i *.deb
- name: make build
run: |
meson build
sudo ninja -C build install
- name: test with javascript files
run: |
r2 -Qc 'Lc' malloc://10
OUTPUT=$(r2 -Qc 'af;pdd' /bin/ls)
CHECK=$(echo -e "$OUTPUT" | grep "r2dec pseudo code output")
echo -e "$OUTPUT"
if [ -z "$CHECK" ]; then
exit 1
fi
sudo ninja -C build uninstall
- name: zip it up
run: |
cp -f build/libcore_pdd.so .
zip r2dec_${{env.R2V}}_linux_amd64.zip libcore_pdd.so
- uses: actions/upload-artifact@v4
with:
name: r2dec_${{env.R2V}}_linux_amd64.zip
path: r2dec_${{env.R2V}}_linux_amd64.zip
# - name: packaging
# run: make -C p/dist/debian
# - name: test deb
# run: |
# sudo dpkg -i p/dist/debian/*.deb
# dpkg-query -L r2dec
# r2 -Qc 'Lc' malloc://10
# OUTPUT=$(r2 -Qc 'af;pdd' /bin/ls)
# CHECK=$(echo -e "$OUTPUT" | grep "r2dec pseudo code output")
# echo -e "$OUTPUT"
# if [ -z "$CHECK" ]; then
# exit 1
# fi
# - uses: actions/upload-artifact@v4
# with:
# name: r2dec-${{env.R2V}}_amd64.deb
# path: p/dist/debian/*.deb
# macos:
# runs-on: macos-latest
# steps:
# - uses: actions/checkout@v4
# - uses: actions/setup-python@v5
# with:
# python-version: 3.7.x
# - name: homebrew dependencies
# run: |
# brew update
# brew install coreutils pkg-config
# pip3 install meson ninja
# - name: install r2
# run: |
# wget -q https://github.com/radareorg/radare2/releases/download/${R2V}/radare2-x64-${R2V}.pkg
# sudo installer -pkg *.pkg -target /
# - name: packaging
# run: make -C p/dist/macos
# - uses: actions/upload-artifact@v4
# with:
# name: r2dec-${{env.R2V}}-amd64.pkg
# path: p/dist/macos/r2dec*.pkg
w64:
runs-on: windows-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: 3.7.x
- name: Preparing msvc toolchain
uses: ilammy/msvc-dev-cmd@v1
with:
arch: x64
- name: dependencies
shell: bash
run: |
pip install ninja meson wget
choco install winflexbison3
choco install zip
- name: install r2
shell: bash
run: |
python -m wget https://github.com/radareorg/radare2/releases/download/${R2V}/radare2-${R2V}-w64.zip -o r2.zip
unzip r2.zip
mv radare2-${R2V}-w64 radare2
- name: meson
shell: cmd
run: |
set PKG_CONFIG_PATH=%CD%\radare2\lib\pkgconfig
set CFLAGS=-I%CD%\radare2\include
set LDFLAGS=-L%CD%\radare2\lib
set PATH=%CD%\radare2\bin;%PATH%
set DESTDIR=%CD%\r2dec-plugin
set BINDIR=%CD%\radare2\bin
set PLUGINDIR=%CD%\radare2\lib\plugins
set ARCH=x64
call "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Auxiliary\Build\vcvarsall.bat" x64
meson --buildtype=release -Dr2_incdir="radare2\include\libr" build || exit /b 666
ninja -C build || exit /b 666
mkdir %DESTDIR%
copy build\*.dll %DESTDIR% || exit /b 666
mkdir "%PLUGINDIR%"
copy build\*.dll "%PLUGINDIR%" || exit /b 666
cd %BINDIR%
radare2.exe -qc "pdd? ; af ; pdd" radare2.exe
- uses: actions/upload-artifact@v4
with:
name: r2dec-${{env.R2V}}-w64.zip
path: r2dec-plugin
w32:
runs-on: windows-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: 3.7.x
- name: Preparing msvc toolchain
uses: ilammy/msvc-dev-cmd@v1
with:
arch: x86
- name: dependencies
shell: bash
run: |
pip install ninja meson wget
choco install winflexbison3
choco install zip
- name: install r2
shell: bash
run: |
python -m wget https://github.com/radareorg/radare2/releases/download/${R2V}/radare2-${R2V}-w32.zip -o r2.zip
unzip r2.zip
mv radare2-${R2V}-w32 radare2
- name: meson
shell: cmd
run: |
set PKG_CONFIG_PATH=%CD%\radare2\lib\pkgconfig
set CFLAGS=-I%CD%\radare2\include
set LDFLAGS=-L%CD%\radare2\lib
set PATH=%CD%\radare2\bin;%PATH%
set DESTDIR=%CD%\r2dec-plugin
set BINDIR=%CD%\radare2\bin
set PLUGINDIR=%CD%\radare2\lib\plugins
set ARCH=x86
call "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Auxiliary\Build\vcvarsall.bat" x86
meson --buildtype=release -Dr2_incdir="radare2\include\libr" build || exit /b 666
ninja -C build || exit /b 666
mkdir %DESTDIR%
copy build\*.dll %DESTDIR% || exit /b 666
mkdir "%PLUGINDIR%"
copy build\*.dll "%PLUGINDIR%" || exit /b 666
cd %BINDIR%
radare2.exe -qc "pdd? ; af ; pdd" radare2.exe
- uses: actions/upload-artifact@v4
with:
name: r2dec-${{env.R2V}}-w32.zip
path: r2dec-plugin