Skip to content

Update Windows build workflow to use MINGW64 and install YARA v4.5.5 #69

Update Windows build workflow to use MINGW64 and install YARA v4.5.5

Update Windows build workflow to use MINGW64 and install YARA v4.5.5 #69

name: fastfinder_build_windows
on: [push, pull_request]
jobs:
windows_standard-build:
runs-on: windows-latest
defaults:
run:
shell: msys2 {0}
steps:
- name: Install MSYS2
uses: msys2/setup-msys2@v2
with:
msystem: MINGW64
path-type: inherit
update: true
install: >-
mingw-w64-x86_64-gcc
mingw-w64-x86_64-toolchain
mingw-w64-x86_64-pkg-config
base-devel
autoconf
automake
libtool
make
unzip
wget
- name: Install YARA v4.5.5
run: |
wget -c https://github.com/VirusTotal/yara/archive/refs/tags/v4.5.5.zip -O /tmp/yara.zip
cd /tmp && unzip yara.zip
cd /tmp/yara-4.5.5
./bootstrap.sh
./configure --prefix=/mingw64 --enable-static --disable-shared
make -j$(nproc)
make install
- name: Set up Go
uses: actions/setup-go@v2
with:
go-version: 1.24
- uses: actions/checkout@v2
- name: Building Fastfinder
shell: powershell
run: |
$Env:PATH += ";C:/msys64/mingw64/include"
$Env:PATH += ";C:/msys64/mingw64/lib"
$Env:PATH += ";C:/msys64/mingw64/lib/pkgconfig"
$Env:GOOS="windows"
$Env:GOARCH="amd64"
$Env:CGO_CFLAGS="-IC:/msys64/mingw64/include"
$Env:CGO_LDFLAGS="-LC:/msys64/mingw64/lib -lyara -lcrypto"
$Env:PKG_CONFIG_PATH="C:/msys64/mingw64/lib/pkgconfig"
cd $Env:GITHUB_WORKSPACE
go build -trimpath -tags yara_static -a -ldflags '-s -w -extldflags "-static"' .
ls
.\fastfinder.exe -h