-
Notifications
You must be signed in to change notification settings - Fork 16
152 lines (135 loc) · 5.88 KB
/
build.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
name: quokka-build
on: [push]
env:
BUILD_TYPE: Release
jobs:
build:
strategy:
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
ida_sdk: [74, 77, 80, 81, 82, 83]
include:
- ida_sdk: 74
sdk_password: IDA_SDK74_PASSWORD
- ida_sdk: 77
sdk_password: IDA_SDK77_PASSWORD
- ida_sdk: 80
sdk_password: IDA_SDK80_PASSWORD
- ida_sdk: 81
sdk_password: IDA_SDK81_PASSWORD
- ida_sdk: 82
sdk_password: IDA_SDK82_PASSWORD
- ida_sdk: 83
sdk_password: IDA_SDK83_PASSWORD
- os: ubuntu-latest
ext: so
- os: windows-latest
ext: dll
- os: macos-latest
ext: dylib
exclude:
# We exclude these because ARM libraries were not available in 7.4 and the latest macos runner on GitHub are Mx machines
- os: macos-latest
ida_sdk: 74
runs-on: ${{ matrix.os }}
steps:
- name: Checkout
uses: actions/[email protected]
- name: Setup cmake
uses: jwlawson/actions-setup-cmake@959f1116cf9f1ae42fff8ec1a4aaae6d4a0e348b #v2.0.1
- name: Install Ninja (Linux / MacOS)
if: ${{ matrix.os == 'ubuntu-latest' || matrix.os == 'macos-latest' }}
uses: seanmiddleditch/gha-setup-ninja@v4
- name: Prepare build environment (Linux)
if: ${{ matrix.os == 'ubuntu-latest' }}
env:
IDA_SDK_VERSION: idasdk${{ matrix.ida_sdk }}
IDA_SDK_PASSWORD: ${{ secrets[matrix.sdk_password] }}
CMAKE_BUILD_DIR: build${{ matrix.ida_sdk }}
run: |
[ ! -d third_party/$IDA_SDK_VERSION ] && unzip -d third_party -P $IDA_SDK_PASSWORD third_party/$IDA_SDK_VERSION.zip
[ -f third_party/$IDA_SDK_VERSION/include/regex.h ] && mv third_party/$IDA_SDK_VERSION/include/regex.h third_party/$IDA_SDK_VERSION/include/regex.bak
cmake -B $CMAKE_BUILD_DIR -S $GITHUB_WORKSPACE -G Ninja -DCMAKE_BUILD_TYPE=${BUILD_TYPE} -DIdaSdk_ROOT_DIR=${GITHUB_WORKSPACE}/third_party/$IDA_SDK_VERSION
# We need to differentiate MacOS build from Linux because we want to use a specific compiler on MacOS
- name: Prepare build environment (MacOS)
if: ${{ matrix.os == 'macos-latest' }}
env:
IDA_SDK_VERSION: idasdk${{ matrix.ida_sdk }}
IDA_SDK_PASSWORD: ${{ secrets[matrix.sdk_password] }}
CMAKE_BUILD_DIR: build${{ matrix.ida_sdk }}
run: |
[ ! -d third_party/$IDA_SDK_VERSION ] && unzip -d third_party -P $IDA_SDK_PASSWORD third_party/$IDA_SDK_VERSION.zip
[ -f third_party/$IDA_SDK_VERSION/include/regex.h ] && mv third_party/$IDA_SDK_VERSION/include/regex.h third_party/$IDA_SDK_VERSION/include/regex.bak
cmake -B $CMAKE_BUILD_DIR \
-S $GITHUB_WORKSPACE \
-G Ninja \
-DCMAKE_BUILD_TYPE=${BUILD_TYPE} \
-DIdaSdk_ROOT_DIR=${GITHUB_WORKSPACE}/third_party/$IDA_SDK_VERSION \
-DCMAKE_C_COMPILER=$(brew --prefix llvm@15)/bin/clang \
-DCMAKE_CXX_COMPILER=$(brew --prefix llvm@15)/bin/clang++
- name: Prepare build environment (Windows)
if: ${{ matrix.os == 'windows-latest' }}
env:
IDA_SDK_VERSION: idasdk${{ matrix.ida_sdk }}
IDA_SDK_PASSWORD: ${{ secrets[matrix.sdk_password] }}
CMAKE_BUILD_DIR: build${{ matrix.ida_sdk }}
run: |
7z.exe x -p"${env:IDA_SDK_PASSWORD}" -y -o"third_party" "third_party\${env:IDA_SDK_VERSION}.zip"
rm "third_party\${env:IDA_SDK_VERSION}\include\regex.h"
cmake -B "${env:CMAKE_BUILD_DIR}" -S "${env:GITHUB_WORKSPACE}" -DIdaSdk_ROOT_DIR="${env:GITHUB_WORKSPACE}/third_party/${env:IDA_SDK_VERSION}"
- name: Build
env:
CMAKE_BUILD_DIR: build${{ matrix.ida_sdk }}
shell: bash
run: |
cmake --build $CMAKE_BUILD_DIR --config $BUILD_TYPE
cmake --install $CMAKE_BUILD_DIR
- name: Rename Plugin
shell: bash
run: |
mv build${{ matrix.ida_sdk }}/quokka-install/quokka_plugin64.${{ matrix.ext }} ${{ matrix.ida_sdk }}-quokka_plugin0064.${{ matrix.ext }}
mv build${{ matrix.ida_sdk }}/quokka-install/quokka_plugin.${{ matrix.ext }} ${{ matrix.ida_sdk }}-quokka_plugin0032.${{ matrix.ext }}
# We need one action per file
# See https://github.com/actions/upload-artifact/issues/331
- name: Upload Artifacts (64)
uses: actions/[email protected]
with:
name: idaplugin-${{ matrix.os }}-${{ matrix.ida_sdk }}
path: ${{ matrix.ida_sdk }}-quokka_plugin0064.${{ matrix.ext }}
if-no-files-found: error
- name: Upload Artifacts (32)
uses: actions/[email protected]
with:
name: idaplugin-${{ matrix.os }}-${{ matrix.ida_sdk }}-32
path: ${{ matrix.ida_sdk }}-quokka_plugin0032.${{ matrix.ext }}
if-no-files-found: error
upload:
name: Upload artifacts for Release
needs: [build]
if: startsWith(github.ref, 'refs/tags/')
runs-on: ubuntu-latest
strategy:
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
ida_sdk: [74, 77, 80, 81, 82, 83]
bitness: ['', '-32']
include:
- os: windows-latest
ext: dll
- os: ubuntu-latest
ext: so
- os: macos-latest
ext: dylib
exclude:
- os: macos-latest
ida_sdk: 74
steps:
- name: Download Artefact
uses: actions/[email protected]
with:
name: idaplugin-${{ matrix.os }}-${{ matrix.ida_sdk }}${{ matrix.bitness }}
- name: Release
uses: softprops/action-gh-release@9d7c94cfd0a1f3ed45544c887983e9fa900f0564 #v2.0.4
with:
files: ${{ matrix.ida_sdk }}-quokka_*
fail_on_unmatched_files: true