|
| 1 | +name: build |
| 2 | + |
| 3 | +on: |
| 4 | + push: |
| 5 | + branches: ["**"] |
| 6 | + tags: ["v*", "V*"] |
| 7 | + pull_request: |
| 8 | + branches: ["**"] |
| 9 | + workflow_dispatch: |
| 10 | + |
| 11 | +permissions: |
| 12 | + contents: write |
| 13 | + |
| 14 | +concurrency: |
| 15 | + group: ci-${{ github.ref }} |
| 16 | + cancel-in-progress: true |
| 17 | + |
| 18 | +jobs: |
| 19 | + build-linux: |
| 20 | + name: Build for Linux |
| 21 | + runs-on: ubuntu-latest |
| 22 | + env: |
| 23 | + IDASDK: ${{ github.workspace }}/ida-sdk/src |
| 24 | + steps: |
| 25 | + - name: Checkout project |
| 26 | + uses: actions/checkout@v4 |
| 27 | + |
| 28 | + - name: Prepare IDA SDK and helpers |
| 29 | + shell: bash |
| 30 | + run: | |
| 31 | + set -euxo pipefail |
| 32 | + git clone --depth 1 https://github.com/HexRaysSA/ida-sdk ida-sdk |
| 33 | + mkdir -p "${IDASDK}" |
| 34 | + git clone --depth 1 https://github.com/allthingsida/ida-cmake "${IDASDK}/ida-cmake" |
| 35 | + mkdir -p "${IDASDK}/include" |
| 36 | + git clone --depth 1 https://github.com/allthingsida/idax "${IDASDK}/include/idax" |
| 37 | +
|
| 38 | + - name: Configure (Linux) |
| 39 | + run: cmake -S . -B build -DCMAKE_BUILD_TYPE=Release |
| 40 | + |
| 41 | + - name: Build (Linux) |
| 42 | + run: cmake --build build -- -j2 |
| 43 | + |
| 44 | + - name: Upload Linux artifact (qscripts.so) |
| 45 | + uses: actions/upload-artifact@v4 |
| 46 | + with: |
| 47 | + name: qscripts-linux |
| 48 | + path: ${{ env.IDASDK }}/bin/plugins/qscripts.so |
| 49 | + |
| 50 | + build-macos: |
| 51 | + name: Build for macOS |
| 52 | + runs-on: macos-latest |
| 53 | + env: |
| 54 | + IDASDK: ${{ github.workspace }}/ida-sdk/src |
| 55 | + steps: |
| 56 | + - name: Checkout project |
| 57 | + uses: actions/checkout@v4 |
| 58 | + |
| 59 | + - name: Prepare IDA SDK and helpers |
| 60 | + shell: bash |
| 61 | + run: | |
| 62 | + set -euxo pipefail |
| 63 | + git clone --depth 1 https://github.com/HexRaysSA/ida-sdk ida-sdk |
| 64 | + mkdir -p "${IDASDK}" |
| 65 | + git clone --depth 1 https://github.com/allthingsida/ida-cmake "${IDASDK}/ida-cmake" |
| 66 | + mkdir -p "${IDASDK}/include" |
| 67 | + git clone --depth 1 https://github.com/allthingsida/idax "${IDASDK}/include/idax" |
| 68 | +
|
| 69 | + - name: Configure (macOS) |
| 70 | + run: cmake -S . -B build -DCMAKE_BUILD_TYPE=Release |
| 71 | + |
| 72 | + - name: Build (macOS) |
| 73 | + run: cmake --build build -- -j2 |
| 74 | + |
| 75 | + - name: Upload macOS artifact (qscripts.dylib) |
| 76 | + uses: actions/upload-artifact@v4 |
| 77 | + with: |
| 78 | + name: qscripts-macos |
| 79 | + path: ${{ env.IDASDK }}/bin/plugins/qscripts.dylib |
| 80 | + |
| 81 | + build-windows: |
| 82 | + name: Build for Windows |
| 83 | + runs-on: windows-latest |
| 84 | + env: |
| 85 | + IDASDK: ${{ github.workspace }}/ida-sdk/src |
| 86 | + steps: |
| 87 | + - name: Checkout project |
| 88 | + uses: actions/checkout@v4 |
| 89 | + |
| 90 | + - name: Prepare IDA SDK and helpers |
| 91 | + shell: bash |
| 92 | + run: | |
| 93 | + set -euxo pipefail |
| 94 | + git clone --depth 1 https://github.com/HexRaysSA/ida-sdk ida-sdk |
| 95 | + mkdir -p "${IDASDK}" |
| 96 | + git clone --depth 1 https://github.com/allthingsida/ida-cmake "${IDASDK}/ida-cmake" |
| 97 | + mkdir -p "${IDASDK}/include" |
| 98 | + git clone --depth 1 https://github.com/allthingsida/idax "${IDASDK}/include/idax" |
| 99 | +
|
| 100 | + - name: Configure (Windows) |
| 101 | + run: cmake -S . -B build -A x64 |
| 102 | + |
| 103 | + - name: Build (Windows) |
| 104 | + run: cmake --build build --config Release -- /m |
| 105 | + |
| 106 | + - name: Upload Windows artifact (qscripts.dll) |
| 107 | + uses: actions/upload-artifact@v4 |
| 108 | + with: |
| 109 | + name: qscripts-windows |
| 110 | + path: ${{ env.IDASDK }}/bin/plugins/qscripts.dll |
| 111 | + |
| 112 | + publish-release: |
| 113 | + name: Publish Release |
| 114 | + runs-on: ubuntu-latest |
| 115 | + needs: [ build-linux, build-macos, build-windows ] |
| 116 | + if: startsWith(github.ref, 'refs/tags/') |
| 117 | + steps: |
| 118 | + - name: Download all artifacts |
| 119 | + uses: actions/download-artifact@v4 |
| 120 | + with: |
| 121 | + pattern: qscripts-* |
| 122 | + path: release |
| 123 | + merge-multiple: true |
| 124 | + |
| 125 | + - name: List release files |
| 126 | + run: | |
| 127 | + ls -la release || true |
| 128 | +
|
| 129 | + - name: Create GitHub Release and upload assets |
| 130 | + uses: softprops/action-gh-release@v2 |
| 131 | + with: |
| 132 | + tag_name: ${{ github.ref_name }} |
| 133 | + name: ${{ github.ref_name }} |
| 134 | + draft: false |
| 135 | + prerelease: false |
| 136 | + generate_release_notes: true |
| 137 | + files: | |
| 138 | + release/qscripts.dylib |
| 139 | + release/qscripts.so |
| 140 | + release/qscripts.dll |
0 commit comments