-
Notifications
You must be signed in to change notification settings - Fork 1
120 lines (107 loc) · 3.26 KB
/
release.yml
File metadata and controls
120 lines (107 loc) · 3.26 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
name: release
on:
push:
tags:
- 'v*'
workflow_dispatch:
inputs:
tag:
description: 'Release tag (e.g., v1.0.0)'
required: true
jobs:
build:
name: Build (${{ matrix.os }})
runs-on: ${{ matrix.runner }}
strategy:
fail-fast: false
matrix:
include:
- os: linux
runner: ubuntu-latest
artifact_ext: so
platform: linux-x86_64
- os: macos
runner: macos-latest
artifact_ext: dylib
platform: macos-aarch64
- os: windows
runner: windows-latest
artifact_ext: dll
platform: windows-x86_64
env:
IDASDK: ${{ github.workspace }}/ida-sdk/src
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: '3.12'
- name: Install pybind11
run: pip install pybind11
- name: Setup IDA SDK
shell: bash
run: |
git clone --depth 1 https://github.com/HexRaysSA/ida-sdk ida-sdk
git clone --depth 1 https://github.com/allthingsida/ida-cmake.git "${IDASDK}/ida-cmake"
- name: Configure
shell: bash
run: |
cmake -B build -DCMAKE_BUILD_TYPE=Release \
-Dpybind11_DIR="$(python -c 'import pybind11; print(pybind11.get_cmake_dir())')"
- name: Build
shell: bash
run: cmake --build build --config Release
- name: Package
shell: bash
run: |
mkdir -p dist
# Copy plugin
find "${IDASDK}/bin/plugins" -name "python_ext.${{ matrix.artifact_ext }}" -exec cp {} dist/ \; 2>/dev/null || \
find build -name "python_ext.${{ matrix.artifact_ext }}" -exec cp {} dist/ \;
# Copy Python module
[ -f mymodule.py ] && cp mymodule.py dist/
# Copy docs
[ -f README.md ] && cp README.md dist/
- name: Create archive
shell: bash
run: |
cd dist
if [ "${{ matrix.os }}" = "windows" ]; then
7z a ../python_ext-${{ matrix.platform }}.zip *
else
zip -r ../python_ext-${{ matrix.platform }}.zip *
fi
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: python_ext-${{ matrix.platform }}
path: python_ext-${{ matrix.platform }}.zip
release:
name: Create Release
needs: build
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Download artifacts
uses: actions/download-artifact@v4
with:
path: artifacts
- name: Get tag
id: tag
run: |
if [ "${{ github.event_name }}" = "workflow_dispatch" ]; then
echo "tag=${{ github.event.inputs.tag }}" >> $GITHUB_OUTPUT
else
echo "tag=${GITHUB_REF#refs/tags/}" >> $GITHUB_OUTPUT
fi
- name: Create Release
uses: softprops/action-gh-release@v2
with:
tag_name: ${{ steps.tag.outputs.tag }}
name: Release ${{ steps.tag.outputs.tag }}
draft: false
prerelease: false
files: artifacts/**/*.zip
generate_release_notes: true