1+ name : Publish
2+
3+ on :
4+ release :
5+ types : [published]
6+
7+ concurrency :
8+ group : release-${{ github.event.release.tag_name }}
9+ cancel-in-progress : false
10+
11+ jobs :
12+ build :
13+ name : Build Plugin (${{ matrix.os }}, py${{ matrix.python }}, ${{ matrix.arch }})
14+ runs-on : ${{ matrix.os }}
15+
16+ strategy :
17+ fail-fast : false
18+ matrix :
19+ include :
20+ - os : ubuntu-latest
21+ python : " 3.10"
22+ arch : x86_64
23+ package-name : linux_x86_64
24+ - os : ubuntu-24.04-arm
25+ python : " 3.10"
26+ arch : arm64
27+ package-name : linux_arm64
28+ - os : macos-latest
29+ python : " 3.10"
30+ arch : arm64
31+ package-name : macos_arm64
32+ - os : macos-15-intel
33+ python : " 3.10"
34+ arch : x86_64
35+ package-name : macos_x86_64
36+ - os : windows-latest
37+ python : " 3.10"
38+ arch : x86_64
39+ package-name : windows_x86_64
40+
41+ steps :
42+ - name : Checkout code
43+ uses : actions/checkout@v4
44+
45+ - name : Set up Python ${{ matrix.python }}
46+ uses : actions/setup-python@v5
47+ with :
48+ python-version : ${{ matrix.python }}
49+
50+ - name : Install uv
51+ uses : astral-sh/setup-uv@v6
52+
53+ - name : Install build tools
54+ run : python -m pip install --upgrade pip setuptools wheel
55+
56+ - name : Build vendor dependencies
57+ run : |
58+ rm -rf images
59+ mkdir -p reai_toolkit/vendor
60+ uv pip install . --target reai_toolkit/vendor --no-cache-dir
61+ rm -rf reai_toolkit/vendor/reai_toolkit
62+ rm -rf reai_toolkit/vendor/reai_toolkit-*.dist-info
63+ shell : bash
64+
65+ - name : Verify vendor folder contents
66+ run : |
67+ echo "Listing vendor packages:"
68+ find reai_toolkit/vendor -maxdepth 2 -type d | head -n 50
69+ shell : bash
70+
71+ - name : Package plugin for release (cross-platform)
72+ run : |
73+ python - <<'PY'
74+ import zipfile, os
75+ from pathlib import Path
76+
77+ os.makedirs("dist", exist_ok=True)
78+ zip_path = f"dist/reveng_binary_ninja_plugin_${{ matrix.package-name }}.zip"
79+
80+ with zipfile.ZipFile(zip_path, 'w', zipfile.ZIP_DEFLATED) as zf:
81+ # Add the entry file to root
82+ zf.write("reai_toolkit_entry.py", "reai_toolkit_entry.py")
83+
84+ # Add all files from reai_toolkit/ to root of zip
85+ for root, dirs, files in os.walk("reai_toolkit"):
86+ for file in files:
87+ file_path = os.path.join(root, file)
88+ # Archive name is relative to reai_toolkit (removes the reai_toolkit/ prefix)
89+ arcname = os.path.relpath(file_path, ".")
90+ zf.write(file_path, arcname)
91+ PY
92+ shell : bash
93+
94+ - name : Upload plugin artifact
95+ uses : actions/upload-artifact@v4
96+ with :
97+ name : reveng_binary_ninja_plugin_${{ matrix.package-name }}
98+ path : dist/*.zip
99+
100+ attach :
101+ name : Attach Artifacts to GitHub Release
102+ runs-on : ubuntu-latest
103+ needs : build
104+
105+ steps :
106+ - name : Download built artifacts
107+ uses : actions/download-artifact@v4
108+ with :
109+ path : dist
110+
111+ - name : List artifacts
112+ run : ls -R dist
113+
114+ - name : Attach to published release
115+ uses : softprops/action-gh-release@v2
116+ with :
117+ tag_name : ${{ github.event.release.tag_name }}
118+ name : ${{ github.event.release.name }}
119+ body : |
120+ RevEng.AI Binary Ninja Plugin
121+
122+ Extract into your Binary Ninja plugins folder.
123+ files : dist/**/*.zip
124+ env :
125+ GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
0 commit comments