Skip to content

Merge pull request #8 from codeyourweb/dev #20

Merge pull request #8 from codeyourweb/dev

Merge pull request #8 from codeyourweb/dev #20

name: fastfinder_build_windows_amd64
on: [push, pull_request]
jobs:
windows_amd64_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
mingw-w64-x86_64-openssl
base-devel
autoconf
automake
libtool
make
unzip
wget
pkg-config
- 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
make -j$(nproc)
make install
# Verify yara.pc installation
ls -la /mingw64/lib/pkgconfig/yara.pc
pkg-config --modversion yara
- name: Set up Go
uses: actions/setup-go@v2
with:
go-version: 1.24
- uses: actions/checkout@v2
- name: Run Unit Tests (AMD64)
run: |
export PKG_CONFIG_PATH="/mingw64/lib/pkgconfig:$PKG_CONFIG_PATH"
export CGO_CFLAGS="-I/mingw64/include"
export CGO_LDFLAGS="-L/mingw64/lib -lyara -lssl -lcrypto"
go test ./... -v
- name: Build FastFinder (AMD64)
run: |
export PKG_CONFIG_PATH="/mingw64/lib/pkgconfig:$PKG_CONFIG_PATH"
export CGO_CFLAGS="-I/mingw64/include"
# Build AMD64
go build -v -ldflags "-s -w" -tags yara_static -o fastfinder.exe .
./fastfinder.exe -h