-
Notifications
You must be signed in to change notification settings - Fork 40
153 lines (129 loc) · 4.27 KB
/
build.yml
File metadata and controls
153 lines (129 loc) · 4.27 KB
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
name: build
on:
push:
branches: ["**"]
tags: ["v*", "V*"]
pull_request:
branches: ["**"]
workflow_dispatch:
permissions:
contents: write
concurrency:
group: ci-${{ github.ref }}
cancel-in-progress: true
jobs:
build-linux:
name: Build for Linux
runs-on: ubuntu-latest
env:
IDASDK: ${{ github.workspace }}/ida-sdk/src
steps:
- name: Checkout project
uses: actions/checkout@v4
- name: Prepare IDA SDK and helpers
shell: bash
run: |
set -euxo pipefail
git clone --depth 1 https://github.com/HexRaysSA/ida-sdk ida-sdk
mkdir -p "${IDASDK}"
git clone --depth 1 https://github.com/allthingsida/ida-cmake "${IDASDK}/ida-cmake"
- name: Configure (Linux)
run: cmake -S . -B build -DCMAKE_BUILD_TYPE=Release
- name: Build (Linux)
run: cmake --build build -- -j2
- name: Upload Linux artifact (qscripts.so)
uses: actions/upload-artifact@v4
with:
name: qscripts-linux
path: ${{ env.IDASDK }}/bin/plugins/qscripts.so
build-macos:
name: Build for macOS
runs-on: macos-latest
env:
IDASDK: ${{ github.workspace }}/ida-sdk/src
steps:
- name: Checkout project
uses: actions/checkout@v4
- name: Prepare IDA SDK and helpers
shell: bash
run: |
set -euxo pipefail
git clone --depth 1 https://github.com/HexRaysSA/ida-sdk ida-sdk
mkdir -p "${IDASDK}"
git clone --depth 1 https://github.com/allthingsida/ida-cmake "${IDASDK}/ida-cmake"
- name: Configure (macOS)
run: cmake -S . -B build -DCMAKE_BUILD_TYPE=Release
- name: Build (macOS)
run: cmake --build build -- -j2
- name: Upload macOS artifact (qscripts.dylib)
uses: actions/upload-artifact@v4
with:
name: qscripts-macos
path: ${{ env.IDASDK }}/bin/plugins/qscripts.dylib
build-windows:
name: Build for Windows
runs-on: windows-latest
env:
IDASDK: ${{ github.workspace }}/ida-sdk/src
steps:
- name: Checkout project
uses: actions/checkout@v4
- name: Prepare IDA SDK and helpers
shell: bash
run: |
set -euxo pipefail
git clone --depth 1 https://github.com/HexRaysSA/ida-sdk ida-sdk
mkdir -p "${IDASDK}"
git clone --depth 1 https://github.com/allthingsida/ida-cmake "${IDASDK}/ida-cmake"
- name: Configure (Windows)
run: cmake -S . -B build -A x64
- name: Build (Windows)
run: cmake --build build --config Release -- /m
- name: Upload Windows artifact (qscripts.dll)
uses: actions/upload-artifact@v4
with:
name: qscripts-windows
path: ${{ env.IDASDK }}/bin/plugins/qscripts.dll
publish-release:
name: Publish Release
runs-on: ubuntu-latest
needs: [ build-linux, build-macos, build-windows ]
if: startsWith(github.ref, 'refs/tags/')
steps:
- name: Checkout project
uses: actions/checkout@v4
- name: Download all artifacts
uses: actions/download-artifact@v4
with:
pattern: qscripts-*
path: release
merge-multiple: true
- name: Copy metadata to release folder
run: |
cp ida-plugin.json release/ || echo "No ida-plugin.json found"
- name: List release files
run: |
ls -la release || true
- name: Create zip package
run: |
cd release
if [ -f ida-plugin.json ]; then
zip -9 qscripts-${{ github.ref_name }}.zip qscripts.dll qscripts.so qscripts.dylib ida-plugin.json
else
zip -9 qscripts-${{ github.ref_name }}.zip qscripts.dll qscripts.so qscripts.dylib
fi
ls -lh *.zip
- name: Create GitHub Release and upload assets
uses: softprops/action-gh-release@v2
with:
tag_name: ${{ github.ref_name }}
name: QScripts ${{ github.ref_name }}
draft: false
prerelease: false
generate_release_notes: true
files: |
release/qscripts-${{ github.ref_name }}.zip
release/qscripts.dll
release/qscripts.so
release/qscripts.dylib
release/ida-plugin.json