-
Notifications
You must be signed in to change notification settings - Fork 83
102 lines (92 loc) · 3.48 KB
/
ci-windows.yml
File metadata and controls
102 lines (92 loc) · 3.48 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
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