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 Nov 27, 2023
1 parent eddb03e commit 92adf3f
Show file tree
Hide file tree
Showing 3 changed files with 1,271 additions and 1 deletion.
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)
43 changes: 42 additions & 1 deletion .github/workflows/build-plugin.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,5 +21,46 @@ 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
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-windows-static-{version}.zip'
unzip rizin.zip
mv rizin-win-* rizin
cd "$WORKDIR"
- name: Build & run the plugin
shell: cmd
run: |
dir
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%
set ARCH=x64
call "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Auxiliary\Build\vcvarsall.bat" x64
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"
rizin.exe -Qc "af ; pdd" "%CD%\..\rizin\bin\rizin.exe"
Loading

0 comments on commit 92adf3f

Please sign in to comment.