-
Notifications
You must be signed in to change notification settings - Fork 44
306 lines (294 loc) · 11.3 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
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
name: ci
env:
R2V: 5.9.0
on:
push:
branches:
- master
pull_request:
jobs:
r2git:
runs-on: ubuntu-latest
strategy:
fail-fast: false
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Installing radare2 from git
run: ( git clone --depth=1 https://github.com/radareorg/radare2 && cd radare2 && sys/install.sh /usr )
- name: Building r2ghidra with acr
run: ./preconfigure && ./configure --prefix=/usr && make -j4 ; make user-install
- name: Testing r2ghidra oneliner on home setup
run: R2_DEBUG=1 r2 -qc 'af;pdg' /bin/ls | tee a.txt && grep entry0 a.txt
- name: System-wide installation
run: make user-uninstall && sudo make install
- name: Testing r2ghidra oneliner on system wide install
run: R2_DEBUG=1 r2 -qc 'af;pdg' /bin/ls | tee a.txt && grep entry0 a.txt
- name: Packaging r2ghidra for Debian
run: make -C dist/debian
- name: Running Testsuite
run: make -C test || exit 0
linux-deb:
runs-on: ubuntu-latest
strategy:
fail-fast: false
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Installing radare2 from deb
run: |
wget https://github.com/radareorg/radare2/releases/download/5.9.0/radare2_5.9.0_amd64.deb
wget https://github.com/radareorg/radare2/releases/download/5.9.0/radare2-dev_5.9.0_amd64.deb
sudo dpkg -i *.deb
- name: Building r2ghidra with acr
run: ./preconfigure && ./configure --prefix=/usr && make -j4 ; make user-install
- name: Testing r2ghidra oneliner on home setup
run: R2_DEBUG=1 r2 -qc 'af;pdg' /bin/ls | tee a.txt && grep entry0 a.txt
- name: System-wide installation
run: make user-uninstall && sudo make install
- name: Testing r2ghidra oneliner on system wide install
run: R2_DEBUG=1 r2 -qc 'af;pdg' /bin/ls | tee a.txt && grep entry0 a.txt
- name: Packaging r2ghidra for Debian using Dockcross
run: make -C dist/debian
- name: Running Testsuite
run: make -C test || exit 0
- name: Uploading debs
uses: actions/upload-artifact@v3
with:
# path: radare2/dist/debian/*/*.deb r2ghidra/dist/debian/*.deb
name: linux-deb
path: dist/debian/*.deb
- name: Precompiling the sleigh
run: make dist
- name: Uploading sleigh
uses: actions/upload-artifact@v3
with:
name: linux-acr-ok
path: r2ghidra_sleigh-*.zip
tarball:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Installing radare2 from deb
run: |
wget https://github.com/radareorg/radare2/releases/download/5.9.0/radare2_5.9.0_amd64.deb
wget https://github.com/radareorg/radare2/releases/download/5.9.0/radare2-dev_5.9.0_amd64.deb
sudo dpkg -i *.deb
rm *.deb
- name: Building tars
run: make -C dist/tarball
- name: Uploading balls
uses: actions/upload-artifact@v3
with:
name: tarball
path: dist/tarball/r2ghidra-*
linux-asan:
if: ${{ false }} # disable for now
# The type of runner that the job will run on
runs-on: ubuntu-latest
strategy:
fail-fast: false
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Installing radare2
# run: ( git clone --depth=1 --branch "${R2V}" https://github.com/radareorg/radare2 && cd radare2 && sys/sanitize.sh --install /usr )
run: ( git clone --depth=1 --branch "${R2V}" https://github.com/radareorg/radare2 && cd radare2 && sys/install.sh --install )
- name: Building r2ghidra with acr
run: ./preconfigure && ./configure && make asan && make -C src sleigh-build && make user-install
- name: Testing r2ghidra oneliner
run: |
r2 -qc 'af;pdg' /bin/ls | tee a.txt
grep entry0 a.txt
linux-meson:
runs-on: ubuntu-latest
strategy:
fail-fast: false
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Downloading Radare2 Debian packages
run: |
wget -O r2.deb https://github.com/radareorg/radare2/releases/download/${{env.R2V}}/radare2_${{env.R2V}}_amd64.deb
wget -O r2-dev.deb https://github.com/radareorg/radare2/releases/download/${{env.R2V}}/radare2-dev_${{env.R2V}}_amd64.deb
- name: Installing Radare2
run: sudo dpkg -i r2.deb r2-dev.deb
- name: Installing User's Meson Ninja
run: pip install ninja meson && ninja --version && meson --version
- name: Installing System's Meson Ninja
run: sudo pip install ninja meson && sudo ninja --version && sudo meson --version
- name: Building r2ghidra with meson
run: ./preconfigure && meson b && ninja -C b && sudo ninja -C b install
- name: Cannot test meson builds, because those cant be installed yet
run: echo nada
# - name: Testing r2ghidra oneliner
# run: |
# r2 -H
# r2 -L
# R2_DEBUG=1 r2 -qc 'af;pdg' /bin/ls | tee a.txt
# grep entry0 a.txt
macos-pkg:
# The type of runner that the job will run on
runs-on: macos-latest
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Cloning Radare2 git repository
run: git clone --depth=1 --branch "${R2V}" https://github.com/radareorg/radare2
- name: Building Radare2 pkg for macOS
run: make -C radare2/dist/macos
- name: Install radare2 Package
run: sudo installer -pkg radare2/dist/macos/*.pkg -target /
- name: Building r2ghidra with acr
run: ./preconfigure && ./configure && make -j4 && make user-install
- name: Packaging r2ghidra
run: |
make -C dist/macos
make install DESTDIR=/tmp/r2ghidra && cd /tmp/r2ghidra && tar czvf ../r2ghidra-macos.tar.gz *
- name: Testing r2ghidra
run: |
r2 -qc 'af;pdg' test/bins/rec | tee a.txt
grep csu_init a.txt
- name: Uploading artifacts
uses: actions/upload-artifact@v3
with:
name: macos-pkg
path: dist/macos/*.zip
#path: radare2/dist/macos/*.pkg src/*.dylib /tmp/r2ghidra-macos.tar.gz dist/macos/*.zip
w64:
runs-on: windows-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v1
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
- name: install r2
shell: bash
run: |
python -m wget https://github.com/radareorg/radare2/releases/download/${{env.R2V}}/radare2-${{env.R2V}}-w64.zip -o r2.zip
python3 -m zipfile -e r2.zip .
mv radare2-${{env.R2V}}-w64 radare2
pwd
- name: batmake
shell: cmd
run: |
call preconfigure.bat
call configure.bat
call make.bat
- uses: actions/upload-artifact@v3
with:
name: w64
path: destdir/r2ghidra-w64.zip
check_release:
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/master' }}
outputs:
is_release: ${{ steps.release.outputs.is }}
tag_name: ${{ steps.release.outputs.tag }}
needs:
- linux-deb
- macos-pkg
- w64
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
with:
fetch-depth: 0 # Download all git history and tags
- name: Check if is a release
run: git describe --exact-match --tags ${{ github.sha }} | awk 'BEGIN{tag="-";r="no"}/^[0-9]+\.[0-9]+/{tag=$0;r="yes"};END{print "is="r;print "tag="tag}' >> ${GITHUB_OUTPUT}
id: release
release:
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/master' && needs.check_release.outputs.is_release == 'yes' }}
needs:
- check_release
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
with:
fetch-depth: 0 # Download all git history and tags
- name: Extract r2g version
run: echo "branch=`./configure -qV`" >> $GITHUB_OUTPUT
id: r2gv
- name: Prepare release notes
run: echo Release > ./RELEASE_NOTES.md
- name: Download artifacts
uses: actions/download-artifact@v3
with:
path: dist/artifacts
- name: Create GitHub release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ needs.check_release.outputs.tag_name }}
release_name: ${{ steps.r2gv.outputs.branch }}
body_path: ./RELEASE_NOTES.md
draft: false
prerelease: false
- name: Upload asset for Linux
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: dist/artifacts/linux-deb/r2ghidra_${{ steps.r2gv.outputs.branch }}_amd64.deb
asset_name: r2ghidra_${{ steps.r2gv.outputs.branch }}_amd64.deb
asset_content_type: application/vnd.debian.binary-package
- name: Upload asset for macOS
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: dist/artifacts/macos-pkg/r2ghidra-${{ steps.r2gv.outputs.branch }}-macos.zip
asset_name: r2ghidra-${{ steps.r2gv.outputs.branch }}-macos.zip
asset_content_type: application/zip
- name: Upload zip
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: dist/artifacts/tarball/r2ghidra-${{ steps.r2gv.outputs.branch }}.zip
asset_name: r2ghidra-${{ steps.r2gv.outputs.branch }}.zip
asset_content_type: application/zip
- name: Upload tarball
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: dist/artifacts/tarball/r2ghidra-${{ steps.r2gv.outputs.branch }}.tar.xz
asset_name: r2ghidra-${{ steps.r2gv.outputs.branch }}.tar.xz
asset_content_type: application/x-txz
- name: Upload asset for Windows (w64)
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: dist/artifacts/w64/r2ghidra-w64.zip
asset_name: r2ghidra-${{ steps.r2gv.outputs.branch }}-w64.zip
asset_content_type: application/zip
- name: Upload asset for Sleigh files
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: dist/artifacts/linux-acr-ok/r2ghidra_sleigh-${{ steps.r2gv.outputs.branch }}.zip
asset_name: r2ghidra_sleigh-${{ steps.r2gv.outputs.branch }}.zip
asset_content_type: application/zip