-
Notifications
You must be signed in to change notification settings - Fork 50
198 lines (194 loc) · 6 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
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.8.8
jobs:
linux:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
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: CFLAGS=-DR2DEC_HOME="\\\"$(r2 -H R2_LIBR_PLUGINS)\\\"" make -j -C p
- name: test with javascript files
run: |
sudo make -C p install
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 make -C p uninstall
- name: make jsc build
run: make -C p clean && CFLAGS=-DR2DEC_HOME="\\\"$(r2 -H R2_LIBR_PLUGINS)\\\"" make -j -C p USE_JSC=1
- name: test with jsc
run: |
sudo make -C p install
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 make -C p uninstall
- name: meson build
run: cd p ; meson -Djsc_folder=".." b && ninja -C b
- 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@v3
with:
name: r2dec-${{env.R2V}}_amd64.deb
path: p/dist/debian/*.deb
macos:
runs-on: macos-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
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@v3
with:
name: r2dec-${{env.R2V}}-amd64.pkg
path: p/dist/macos/r2dec*.pkg
w64:
runs-on: windows-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
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
set R2_DEBUG=1
call "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Auxiliary\Build\vcvarsall.bat" x64
cd p
meson --buildtype=release -Dc_args=-DDUK_USE_DATE_NOW_WINDOWS -Djsc_folder=".." b
ninja -C b
mkdir %DESTDIR%
copy b\*.dll %DESTDIR%
mkdir "%PLUGINDIR%"
copy b\*.dll "%PLUGINDIR%"
cd %BINDIR%
radare2.exe -Qc "pdd? ; aa ; pdd" radare2.exe
- uses: actions/upload-artifact@v3
with:
name: r2dec-${{env.R2V}}-w64.zip
path: r2dec-plugin
w32:
runs-on: windows-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
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
set R2_DEBUG=1
call "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Auxiliary\Build\vcvarsall.bat" x86
cd p
meson --buildtype=release -Dc_args=-DDUK_USE_DATE_NOW_WINDOWS -Djsc_folder=".." b
ninja -C b
mkdir %DESTDIR%
copy b\*.dll %DESTDIR%
mkdir "%PLUGINDIR%"
copy b\*.dll "%PLUGINDIR%"
cd %BINDIR%
radare2.exe -Qc "pdd? ; aa ; pdd" radare2.exe
- uses: actions/upload-artifact@v3
with:
name: r2dec-${{env.R2V}}-w32.zip
path: r2dec-plugin