-
Notifications
You must be signed in to change notification settings - Fork 90
308 lines (304 loc) · 10.4 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
307
308
name: iaito CI
env:
R2V: 5.8.8
on:
push:
branches:
- master
pull_request:
branches:
- master
jobs:
acr-linux-r2git:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v3
with:
submodules: false # 'recursive' 'true' or 'false'
persist-credentials: false
- uses: actions/setup-python@v4
with:
python-version: 3.8.x
- name: apt dependencies
run: |
sudo apt-get update
sudo apt install -y libgraphviz-dev mesa-common-dev ninja-build meson
sudo apt install -y libqt5svg5-dev qttools5-dev qttools5-dev-tools
sudo apt install -y qtbase5-dev qtchooser qt5-qmake qtbase5-dev-tools
- name: install r2
run: git clone --depth=1 https://github.com/radareorg/radare2 r2git && CFLAGS=-O0 r2git/sys/install.sh
- name: build iaito
run: |
./configure --prefix=/usr
make -j4
- name: packaging
run: |
make -j -C dist/debian
- uses: actions/upload-artifact@v3
with:
name: iaito-amd64.deb
path: dist/debian/*/*.deb
acr-linux:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v3
with:
submodules: false # 'recursive' 'true' or 'false'
persist-credentials: false
- uses: actions/setup-python@v1
with:
python-version: 3.8.x
- name: apt dependencies
run: |
sudo apt-get update
sudo apt install -y libgraphviz-dev mesa-common-dev ninja-build
sudo apt install -y libqt5svg5-dev qttools5-dev qttools5-dev-tools
sudo apt install -y qtbase5-dev qtchooser qt5-qmake qtbase5-dev-tools
- name: install r2
run: |
wget -q https://github.com/radareorg/radare2/releases/download/${{env.R2V}}/radare2_${{env.R2V}}_amd64.deb
wget -q https://github.com/radareorg/radare2/releases/download/${{env.R2V}}/radare2-dev_${{env.R2V}}_amd64.deb
sudo dpkg -i *.deb
- name: build iaito
run: |
./configure --prefix=/usr
make -j4
- name: packaging
run: |
make -C dist/debian
- uses: actions/upload-artifact@v3
with:
name: iaito-amd64.deb
path: dist/debian/*/*.deb
acr-macos:
runs-on: macos-latest
steps:
- uses: actions/checkout@v3
with:
submodules: false # 'recursive' 'true' or 'false'
persist-credentials: false
- uses: actions/setup-python@v1
with:
python-version: 3.8.x
- name: homebrew dependencies
run: |
brew update
brew install pkg-config qt@5
brew unlink qt@5 || true
brew link --force qt@5
pip3 install meson
pip3 install ninja
- name: install r2
run: |
wget -q https://github.com/radareorg/radare2/releases/download/${{env.R2V}}/radare2-x64-${{env.R2V}}.pkg
sudo installer -pkg *.pkg -target /
- name: build iaito
run: |
export PATH="/usr/local/opt/qt@5/bin:$PATH"
export PATH="/opt/homebrew/opt/qt@5/bin:$PATH" # doesnt seems to be necessary
export LDFLAGS="-L/usr/local/opt/qt@5/lib"
export CPPFLAGS="-I/usr/local/opt/qt@5/include"
export PKG_CONFIG_PATH="/usr/local/opt/qt@5/lib/pkgconfig"
./configure
make -j4
- name: packaging
run: |
make -C dist/macos
- uses: actions/upload-artifact@v3
with:
name: iaito-x64.dmg
path: dist/macos/iaito.dmg
meson:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-22.04, ubuntu-20.04]
python-version: [3.8.x]
system-deps: [true]
cc-override: [default]
cxx-override: [default]
# Prevent one job from pausing the rest
fail-fast: false
steps:
- uses: actions/checkout@v3
with:
submodules: false # 'recursive' 'true' or 'false'
persist-credentials: false
- name: apt dependencies
if: contains(matrix.os, 'ubuntu')
run: |
sudo apt-get update
sudo apt-get install libgraphviz-dev mesa-common-dev
sudo apt-get install ninja-build make git patch wget
sudo apt install -y libqt5svg5-dev qttools5-dev qttools5-dev-tools
sudo apt install -y qtbase5-dev qtchooser qt5-qmake qtbase5-dev-tools
- name: install r2
run: git clone --depth=1 https://github.com/radareorg/radare2 r2git && CFLAGS=-O0 r2git/sys/install.sh
- uses: actions/setup-python@v1
with:
python-version: ${{ matrix.python-version }}
- name: homebrew dependencies
if: contains(matrix.os, 'macos')
run: |
brew update --preinstall # temporary workaround for https://github.com/Homebrew/homebrew-bundle/issues/751
brew install coreutils pkg-config
brew install pkg-config qt@5
brew unlink qt@5 || true
brew link --force qt@5
pip3 install meson
pip3 install ninja
- name: macos build
if: contains(matrix.os, 'macos')
run: |
cd src && meson ../build
cd ../build && ninja -j4
- name: meson+ninja ubuntu
if: contains(matrix.os, 'ubuntu')
run: |
pip install meson
cd src && meson ../build
cd ../build && ninja -j4
w64-meson:
runs-on: windows-latest
steps:
- uses: actions/checkout@v3
with:
submodules: false
persist-credentials: false
- name: Preparing msvc toolchain
uses: ilammy/msvc-dev-cmd@v1
with:
arch: x64
# - uses: actions/setup-python@v1
# with:
# python-version: 3.8.x
# - name: Prepare Qt
# working-directory: build
# shell: cmd
# run: |
# curl -vLo qt-unified-windows-x86-online.exe http://download.qt.io/official_releases/online_installers/qt-unified-windows-x86-online.exe
# qt-unified-windows-x86-online.exe --verbose --script ..\ci\qt.qs
- name: Install Qt
uses: jurplel/install-qt-action@v3
- name: dependencies
shell: cmd
run: |
pip install ninja meson wget
choco install zip
- 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
unzip r2.zip
mv radare2-${{env.R2V}}-w64 radare2
pwd
- name: w64-make
shell: cmd
run: |
SET ARCH=x64
set PATH=%CD%\r2_dist\bin;%PATH%
call preconfigure.bat
call configure.bat
call make.bat
zip -r iaito.zip iaito
dir /s
- uses: actions/upload-artifact@v3
with:
name: iaito.exe
path: iaito\iaito.exe
- uses: actions/upload-artifact@v3
with:
name: iaito.zip
path: iaito.zip
- uses: actions/upload-artifact@v3
with:
name: ${{ env.PACKAGE_NAME }}
path: build/${{ env.PACKAGE_NAME }}
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:
- acr-linux
- acr-macos
- w64-meson
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 version
run: echo "string=`./configure -qV`" >> $GITHUB_OUTPUT
id: version
- name: Prepare release notes
run: ./scripts/release-notes.sh | tee ./RELEASE_NOTES.md
- name: Download artifacts
uses: actions/download-artifact@v2
with:
path: dist/artifacts
- name: Display structure of downloaded files
run: find 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.version.outputs.string }}
body_path: ./RELEASE_NOTES.md
draft: false
prerelease: false
- name: Prepare release notes
run: ./scripts/release-notes.sh | tee ./RELEASE_NOTES.md
- name: Upload Linux asset
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/iaito-amd64.deb/iaito/iaito_${{ steps.version.outputs.string }}_amd64.deb
asset_name: iaito_${{ steps.version.outputs.string }}_amd64.deb
asset_content_type: application/vnd.debian.binary-package
- name: Upload macOS asset
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/iaito-x64.dmg/iaito/iaito_x64.dmg
asset_name: iaito_${{ steps.version.outputs.string }}_x64.dmg
asset_content_type: application/vnd.debian.binary-package
- name: Upload Windows QtDeploy asset
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/iaito.zip/iaito.zip
asset_name: iaito-${{ steps.version.outputs.string }}-macos.zip
asset_content_type: application/zip
- name: Upload Windows executable
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/iaito.exe/iaito.exe
asset_name: iaito-${{ steps.version.outputs.string }}.exe
asset_content_type: application/zip