Bump the actions group across 1 directory with 7 updates #260
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: quokka-build | |
on: [push] | |
env: | |
BUILD_TYPE: Release | |
permissions: {} | |
jobs: | |
build: | |
strategy: | |
matrix: | |
os: [ubuntu-latest, windows-latest, macos-latest] | |
ida_sdk: [74, 77, 80, 81, 82, 83, 84, 85, 90, 90sp1, 91] | |
include: | |
- os: ubuntu-latest | |
ext: so | |
- os: windows-latest | |
ext: dll | |
- os: macos-latest | |
ext: dylib | |
exclude: | |
# We exclude these because ARM libraries were not available in 7.4 and the latest macos runner on GitHub are Mx machines | |
- os: macos-latest | |
ida_sdk: 74 | |
runs-on: ${{ matrix.os }} | |
steps: | |
- name: Set IDA SDK password | |
shell: bash | |
run: | | |
case "${{ matrix.ida_sdk }}" in | |
74) echo "IDA_SDK_PASSWORD=${{ secrets.IDA_SDK74_PASSWORD }}" >> "$GITHUB_ENV" ;; | |
77) echo "IDA_SDK_PASSWORD=${{ secrets.IDA_SDK77_PASSWORD }}" >> "$GITHUB_ENV" ;; | |
80) echo "IDA_SDK_PASSWORD=${{ secrets.IDA_SDK80_PASSWORD }}" >> "$GITHUB_ENV" ;; | |
81) echo "IDA_SDK_PASSWORD=${{ secrets.IDA_SDK81_PASSWORD }}" >> "$GITHUB_ENV" ;; | |
82) echo "IDA_SDK_PASSWORD=${{ secrets.IDA_SDK82_PASSWORD }}" >> "$GITHUB_ENV" ;; | |
83) echo "IDA_SDK_PASSWORD=${{ secrets.IDA_SDK83_PASSWORD }}" >> "$GITHUB_ENV" ;; | |
84) echo "IDA_SDK_PASSWORD=${{ secrets.IDA_SDK84_PASSWORD }}" >> "$GITHUB_ENV" ;; | |
85) echo "IDA_SDK_PASSWORD=${{ secrets.IDA_SDK85_PASSWORD }}" >> "$GITHUB_ENV" ;; | |
90) echo "IDA_SDK_PASSWORD=${{ secrets.IDA_SDK90_PASSWORD }}" >> "$GITHUB_ENV" ;; | |
90sp1) echo "IDA_SDK_PASSWORD=${{ secrets.IDA_SDK90sp1_PASSWORD }}" >> "$GITHUB_ENV" ;; | |
91) echo "IDA_SDK_PASSWORD=${{ secrets.IDA_SDK91_PASSWORD }}" >> "$GITHUB_ENV" ;; | |
*) echo "No password defined for this IDA SDK version" && exit 1 ;; | |
esac | |
- name: Checkout | |
uses: actions/checkout@v5 | |
with: | |
persist-credentials: false | |
- name: Cache third_party folder | |
id: cache-sdk | |
uses: actions/cache@v4 | |
with: | |
path: third_party | |
key: ${{ matrix.os }}-third-party-${{ hashFiles('sdk_lockfile') }} | |
- name: Setup cmake | |
uses: jwlawson/[email protected] | |
with: | |
cmake-version: "latest" | |
- name: Install Ninja (Linux / MacOS) | |
if: ${{ matrix.os == 'ubuntu-latest' || matrix.os == 'macos-latest' }} | |
uses: seanmiddleditch/gha-setup-ninja@v6 | |
- name: Fetch IDA SDKs (Linux / MacOS) | |
if: ${{ (matrix.os == 'ubuntu-latest' || matrix.os == 'macos-latest') && steps.cache-sdk.outputs.cache-hit != 'true' }} | |
run: | | |
cd scripts | |
./fetch_sdk.sh | |
- name: Fetch IDA SDKs (Windows) | |
if: ${{ matrix.os == 'windows-latest' && steps.cache-sdk.outputs.cache-hit != 'true' }} | |
run: | | |
cd scripts | |
.\fetch_sdk.bat | |
- name: Prepare build environment (Linux) | |
if: ${{ matrix.os == 'ubuntu-latest' }} | |
env: | |
IDA_SDK_VERSION: idasdk${{ matrix.ida_sdk }} | |
CMAKE_BUILD_DIR: build${{ matrix.ida_sdk }} | |
run: | | |
[ ! -d third_party/$IDA_SDK_VERSION ] && unzip -d third_party -P $IDA_SDK_PASSWORD third_party/$IDA_SDK_VERSION.zip | |
[ -f third_party/$IDA_SDK_VERSION/include/regex.h ] && mv third_party/$IDA_SDK_VERSION/include/regex.h third_party/$IDA_SDK_VERSION/include/regex.bak | |
cmake -B $CMAKE_BUILD_DIR -S $GITHUB_WORKSPACE -G Ninja -DCMAKE_BUILD_TYPE=${BUILD_TYPE} -DIdaSdk_ROOT_DIR=${GITHUB_WORKSPACE}/third_party/$IDA_SDK_VERSION | |
# We need to differentiate MacOS build from Linux because we want to use a specific compiler on MacOS | |
- name: Prepare build environment (MacOS) | |
if: ${{ matrix.os == 'macos-latest' }} | |
env: | |
IDA_SDK_VERSION: idasdk${{ matrix.ida_sdk }} | |
CMAKE_BUILD_DIR: build${{ matrix.ida_sdk }} | |
run: | | |
[ ! -d third_party/$IDA_SDK_VERSION ] && unzip -d third_party -P $IDA_SDK_PASSWORD third_party/$IDA_SDK_VERSION.zip | |
[ -f third_party/$IDA_SDK_VERSION/include/regex.h ] && mv third_party/$IDA_SDK_VERSION/include/regex.h third_party/$IDA_SDK_VERSION/include/regex.bak | |
cmake -B $CMAKE_BUILD_DIR \ | |
-S $GITHUB_WORKSPACE \ | |
-G Ninja \ | |
-DCMAKE_BUILD_TYPE=${BUILD_TYPE} \ | |
-DIdaSdk_ROOT_DIR=${GITHUB_WORKSPACE}/third_party/$IDA_SDK_VERSION \ | |
-DLLVM_ROOT=$(brew --prefix llvm@15) | |
- name: Prepare build environment (Windows) | |
if: ${{ matrix.os == 'windows-latest' }} | |
env: | |
IDA_SDK_VERSION: idasdk${{ matrix.ida_sdk }} | |
CMAKE_BUILD_DIR: build${{ matrix.ida_sdk }} | |
run: | | |
7z.exe x -p"${env:IDA_SDK_PASSWORD}" -y -o"third_party" "third_party\${env:IDA_SDK_VERSION}.zip" | |
rm "third_party\${env:IDA_SDK_VERSION}\include\regex.h" | |
cmake -B "${env:CMAKE_BUILD_DIR}" -S "${env:GITHUB_WORKSPACE}" -DIdaSdk_ROOT_DIR="${env:GITHUB_WORKSPACE}/third_party/${env:IDA_SDK_VERSION}" | |
- name: Build | |
env: | |
CMAKE_BUILD_DIR: build${{ matrix.ida_sdk }} | |
shell: bash | |
run: | | |
cmake --build $CMAKE_BUILD_DIR --config $BUILD_TYPE | |
cmake --install $CMAKE_BUILD_DIR | |
- name: Rename Plugin | |
shell: bash | |
run: | | |
mv build${{ matrix.ida_sdk }}/quokka-install/quokka_plugin64.${{ matrix.ext }} ${{ matrix.ida_sdk }}-quokka_plugin0064.${{ matrix.ext }} | |
[[ -e "build${{ matrix.ida_sdk }}/quokka-install/quokka_plugin.${{ matrix.ext }}" ]] && mv build${{ matrix.ida_sdk }}/quokka-install/quokka_plugin.${{ matrix.ext }} ${{ matrix.ida_sdk }}-quokka_plugin0032.${{ matrix.ext }} || echo "Skipping 32 bit plugin" | |
# We need one action per file | |
# See https://github.com/actions/upload-artifact/issues/331 | |
- name: Upload Artifacts (64) | |
uses: actions/[email protected] | |
with: | |
name: idaplugin-${{ matrix.os }}-${{ matrix.ida_sdk }} | |
path: ${{ matrix.ida_sdk }}-quokka_plugin0064.${{ matrix.ext }} | |
if-no-files-found: error | |
- name: Upload Artifacts (32) | |
if: ${{ contains('74,77,80,81,82,83,84', matrix.ida_sdk) }} | |
uses: actions/[email protected] | |
with: | |
name: idaplugin-${{ matrix.os }}-${{ matrix.ida_sdk }}-32 | |
path: ${{ matrix.ida_sdk }}-quokka_plugin0032.${{ matrix.ext }} | |
if-no-files-found: error | |
upload: | |
name: Upload artifacts for Release | |
needs: [build] | |
if: startsWith(github.ref, 'refs/tags/') | |
runs-on: ubuntu-latest | |
permissions: | |
contents: write | |
strategy: | |
matrix: | |
os: [ubuntu-latest, windows-latest, macos-latest] | |
ida_sdk: [74, 77, 80, 81, 82, 83, 84, 85, 90, 90sp1, 91] | |
bitness: ["", "-32"] | |
include: | |
- os: windows-latest | |
ext: dll | |
- os: ubuntu-latest | |
ext: so | |
- os: macos-latest | |
ext: dylib | |
exclude: | |
- os: macos-latest | |
ida_sdk: 74 | |
- ida_sdk: 85 | |
bitness: "-32" | |
- ida_sdk: 90 | |
bitness: "-32" | |
- ida_sdk: 90sp1 | |
bitness: "-32" | |
- ida_sdk: 91 | |
bitness: "-32" | |
steps: | |
- name: Download Artefact | |
uses: actions/download-artifact@v5 | |
with: | |
name: idaplugin-${{ matrix.os }}-${{ matrix.ida_sdk }}${{ matrix.bitness }} | |
- name: Release | |
uses: softprops/[email protected] | |
with: | |
files: ${{ matrix.ida_sdk }}-quokka_* | |
fail_on_unmatched_files: true |