WIP CI #335
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: Build for Windows | |
| on: | |
| push: | |
| pull_request: | |
| release: | |
| types: # This configuration does not affect the page_build event above | |
| - created | |
| jobs: | |
| build: | |
| runs-on: windows-2019 | |
| steps: | |
| - uses: actions/checkout@v1 | |
| with: | |
| submodules: true | |
| - name: Install Triton | |
| run: | | |
| "`r`nset(VCPKG_BUILD_TYPE release)" | Add-Content "$env:VCPKG_INSTALLATION_ROOT\triplets\x64-windows-static.cmake" | |
| vcpkg install triton --triplet x64-windows-static | |
| - name: Clone IDA-SDKs repo | |
| run: | | |
| git clone https://x-access-token:${{ secrets.SDK_REPO_ACCESS_TOKEN }}@github.com/illera88/IDA-SDKs.git IDA_SDKs | |
| - name: List SDK zips and extract versions | |
| id: sdk_versions | |
| shell: bash | |
| run: | | |
| cd IDA_SDKs | |
| versions=() | |
| for f in idasdk*.zip; do | |
| if [[ "$f" =~ idasdk([0-9])([0-9])\.zip ]]; then | |
| major="${BASH_REMATCH[1]}" | |
| minor="${BASH_REMATCH[2]}" | |
| echo "Found SDK version $major.$minor" | |
| versions+=("${major}.${minor}") | |
| # Unzip each SDK to its own folder | |
| 7z.exe x "$f" | |
| fi | |
| done | |
| echo "VERSIONS=${versions[*]}" >> $GITHUB_ENV | |
| - name: Build Ponce for all SDKs | |
| shell: bash | |
| run: | | |
| SKIP_VERSIONS="9.0" # IDA 9.0 is not supported yet | |
| for version in $VERSIONS; do | |
| major="${version%%.*}" | |
| minor="${version##*.}" | |
| if [[ " $SKIP_VERSIONS " == *" $version "* ]]; then | |
| echo "Skipping version $version" | |
| continue | |
| fi | |
| sdkdir="./IDA_SDKs/idasdk${major}${minor}" | |
| builddir="build_x64_${major}.${minor}" | |
| echo "Building for IDA SDK $major.$minor" | |
| cmake -S . -B $builddir -DIDASDK_ROOT_DIR="./$sdkdir" -DSTATICLIB=ON -DCMAKE_BUILD_TYPE=Release -G "Visual Studio 16 2019" -A x64 -DVCPKG_TARGET_TRIPLET="x64-windows-static" -DCMAKE_TOOLCHAIN_FILE="$VCPKG_INSTALLATION_ROOT/scripts/buildsystems/vcpkg.cmake" -DCMAKE_CXX_FLAGS="-Wno-format" | |
| cmake --build $builddir --config Release --parallel 2 | |
| # Optionally, upload artifact here or collect for later | |
| done | |
| # To upload the artifacts dynamically we need to do a little hack | |
| - name: Upload all built DLLs | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: ponce-windows-artifacts | |
| path: | | |
| build_x64_*/Release/Ponce.dll | |
| build_x64_*/Release/Ponce64.dll | |
| release: | |
| runs-on: ubuntu-latest | |
| if: github.event_name == 'release' | |
| needs: build | |
| steps: | |
| - name: Download all Windows arifacts | |
| uses: actions/download-artifact@v2 | |
| with: | |
| path: ./my_artifacts | |
| - name: Set output | |
| id: vars | |
| run: | | |
| echo ::set-output name=tag::${GITHUB_REF#refs/*/} | |
| - name: Build zip file | |
| env: | |
| RELEASE_VERSION: ${{ steps.vars.outputs.tag }} | |
| run: | | |
| cd my_artifacts | |
| zip -r ../ponce-$RELEASE_VERSION-win.zip * | |
| - name: Upload Windows artifacts | |
| uses: actions/upload-release-asset@v1 | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| with: | |
| upload_url: ${{ github.event.release.upload_url }} | |
| asset_path: ./ponce-${{ steps.vars.outputs.tag }}-win.zip | |
| asset_name: ponce-${{ steps.vars.outputs.tag }}-win.zip | |
| asset_content_type: application/zip |