Skip to content

Commit b3e6ffa

Browse files
committed
feat: Add CI/CD and release workflows
- Add build.yml for continuous integration on all platforms - Add release.yml for automated releases on tags - Builds both eject_idb executable and eject_plugin
1 parent 4a0681c commit b3e6ffa

2 files changed

Lines changed: 159 additions & 0 deletions

File tree

.github/workflows/build.yml

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
name: build
2+
3+
on:
4+
push:
5+
branches: ["**"]
6+
pull_request:
7+
branches: ["**"]
8+
workflow_dispatch:
9+
10+
concurrency:
11+
group: ci-${{ github.ref }}
12+
cancel-in-progress: true
13+
14+
jobs:
15+
build:
16+
name: Build (${{ matrix.os }})
17+
runs-on: ${{ matrix.runner }}
18+
strategy:
19+
fail-fast: false
20+
matrix:
21+
include:
22+
- os: Linux
23+
runner: ubuntu-latest
24+
- os: macOS
25+
runner: macos-latest
26+
- os: Windows
27+
runner: windows-latest
28+
env:
29+
IDASDK: ${{ github.workspace }}/ida-sdk/src
30+
steps:
31+
- name: Checkout
32+
uses: actions/checkout@v4
33+
34+
- name: Setup IDA SDK
35+
shell: bash
36+
run: |
37+
git clone --depth 1 https://github.com/HexRaysSA/ida-sdk ida-sdk
38+
git clone --depth 1 https://github.com/allthingsida/ida-cmake.git "${IDASDK}/ida-cmake"
39+
40+
- name: Configure
41+
shell: bash
42+
run: cmake -B build -DCMAKE_BUILD_TYPE=Release
43+
44+
- name: Build
45+
shell: bash
46+
run: cmake --build build --config Release

.github/workflows/release.yml

Lines changed: 113 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,113 @@
1+
name: release
2+
3+
on:
4+
push:
5+
tags:
6+
- 'v*'
7+
workflow_dispatch:
8+
inputs:
9+
tag:
10+
description: 'Release tag (e.g., v1.0.0)'
11+
required: true
12+
13+
jobs:
14+
build:
15+
name: Build (${{ matrix.os }})
16+
runs-on: ${{ matrix.runner }}
17+
strategy:
18+
fail-fast: false
19+
matrix:
20+
include:
21+
- os: linux
22+
runner: ubuntu-latest
23+
plugin_ext: so
24+
exe_ext: ""
25+
platform: linux-x86_64
26+
- os: macos
27+
runner: macos-latest
28+
plugin_ext: dylib
29+
exe_ext: ""
30+
platform: macos-aarch64
31+
- os: windows
32+
runner: windows-latest
33+
plugin_ext: dll
34+
exe_ext: .exe
35+
platform: windows-x86_64
36+
env:
37+
IDASDK: ${{ github.workspace }}/ida-sdk/src
38+
steps:
39+
- name: Checkout
40+
uses: actions/checkout@v4
41+
42+
- name: Setup IDA SDK
43+
shell: bash
44+
run: |
45+
git clone --depth 1 https://github.com/HexRaysSA/ida-sdk ida-sdk
46+
git clone --depth 1 https://github.com/allthingsida/ida-cmake.git "${IDASDK}/ida-cmake"
47+
48+
- name: Configure
49+
shell: bash
50+
run: cmake -B build -DCMAKE_BUILD_TYPE=Release
51+
52+
- name: Build
53+
shell: bash
54+
run: cmake --build build --config Release
55+
56+
- name: Package
57+
shell: bash
58+
run: |
59+
mkdir -p dist
60+
# Copy plugin
61+
find "${IDASDK}/bin/plugins" -name "eject_plugin.${{ matrix.plugin_ext }}" -exec cp {} dist/ \; 2>/dev/null || \
62+
find build -name "eject_plugin.${{ matrix.plugin_ext }}" -exec cp {} dist/ \;
63+
# Copy executable
64+
find build -name "eject_idb${{ matrix.exe_ext }}" -exec cp {} dist/ \; 2>/dev/null || true
65+
# Copy docs
66+
[ -f README.md ] && cp README.md dist/
67+
68+
- name: Create archive
69+
shell: bash
70+
run: |
71+
cd dist
72+
if [ "${{ matrix.os }}" = "windows" ]; then
73+
7z a ../eject_idb-${{ matrix.platform }}.zip *
74+
else
75+
zip -r ../eject_idb-${{ matrix.platform }}.zip *
76+
fi
77+
78+
- name: Upload artifact
79+
uses: actions/upload-artifact@v4
80+
with:
81+
name: eject_idb-${{ matrix.platform }}
82+
path: eject_idb-${{ matrix.platform }}.zip
83+
84+
release:
85+
name: Create Release
86+
needs: build
87+
runs-on: ubuntu-latest
88+
permissions:
89+
contents: write
90+
steps:
91+
- name: Download artifacts
92+
uses: actions/download-artifact@v4
93+
with:
94+
path: artifacts
95+
96+
- name: Get tag
97+
id: tag
98+
run: |
99+
if [ "${{ github.event_name }}" = "workflow_dispatch" ]; then
100+
echo "tag=${{ github.event.inputs.tag }}" >> $GITHUB_OUTPUT
101+
else
102+
echo "tag=${GITHUB_REF#refs/tags/}" >> $GITHUB_OUTPUT
103+
fi
104+
105+
- name: Create Release
106+
uses: softprops/action-gh-release@v2
107+
with:
108+
tag_name: ${{ steps.tag.outputs.tag }}
109+
name: Release ${{ steps.tag.outputs.tag }}
110+
draft: false
111+
prerelease: false
112+
files: artifacts/**/*.zip
113+
generate_release_notes: true

0 commit comments

Comments
 (0)