Skip to content

Commit

Permalink
Add CI flow for win64 plugin build
Browse files Browse the repository at this point in the history
  • Loading branch information
wargio committed Feb 11, 2024
1 parent c88c009 commit 9444500
Show file tree
Hide file tree
Showing 4 changed files with 1,279 additions and 1 deletion.
11 changes: 11 additions & 0 deletions .ci-scripts/ci-build-win.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
echo off
set ARCH="%1"
set PKG_CONFIG_PATH=%CD%\..\rizin\lib\pkgconfig
set CFLAGS="-I%CD%\..\rizin\include\librz -I%CD%\..\rizin\include\librz\sdb"
set LDFLAGS=-L%CD%\..\rizin\lib
set PATH=%CD%\..\rizin\bin;%PATH%
call "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Auxiliary\Build\vcvarsall.bat" "%ARCH%"
meson --buildtype=release --prefix="%CD%\..\rizin" build || exit /b 666
ninja -C build install || exit /b 666
rizin.exe -e log.level=2 -Qc "Lc" || exit /b 0
rizin.exe -Qc "af ; pdd" "%CD%\..\rizin\bin\rizin.exe" || exit /b 0
22 changes: 22 additions & 0 deletions .ci-scripts/ci-rizin-dl.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
import urllib.request
import json
import sys
import os

file_name = sys.argv[1]
_, file_extension = os.path.splitext(file_name)
out_file = f"rizin{file_extension}"
print(file_name, out_file)

tags = None
with urllib.request.urlopen('https://api.github.com/repos/rizinorg/rizin/tags?per_page=1') as f:
tags = json.load(f)
latest = tags[0]['name']

url = f"https://github.com/rizinorg/rizin/releases/download/{latest}/{file_name}"
url = url.format(version=latest)

print(f"Latest rizin tag: {latest}")
print(f"{url} as {out_file}")

urllib.request.urlretrieve(url, out_file)
40 changes: 39 additions & 1 deletion .github/workflows/build-plugin.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,5 +21,43 @@ jobs:
uses: actions/checkout@v3
- name: Install dependencies
run: sudo apt -y install meson ninja-build
- name: build & run the plugin
- name: Build & run the plugin
run: bash .ci-scripts/ci-build-linux.sh "${{ github.ref_name }}"

windows-64:
runs-on: windows-latest
name: ${{ matrix.release }}
strategy:
fail-fast: false
matrix:
release:
- 'windows-static'
- 'windows-shared64'
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: 3.9.x
- name: Preparing msvc toolchain
uses: ilammy/msvc-dev-cmd@v1
with:
arch: x64
- name: Install dependencies
shell: bash
run: |
pip install ninja meson
choco install pkgconfiglite
choco install zip
- name: Install rizin
shell: bash
run: |
WORKDIR="$PWD"
cd ..
python "$WORKDIR/.ci-scripts/ci-rizin-dl.py" 'rizin-${{ matrix.release }}-{version}.zip'
unzip rizin.zip
rm *.zip
mv rizin* rizin
cd "$WORKDIR"
- name: Build & run the plugin
shell: cmd
run: .ci-scripts/ci-build-win.bat x64
Loading

0 comments on commit 9444500

Please sign in to comment.