Refactor CI workflows for cross-platform builds #1
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: fastfinder_build_windows_386 | |
| on: [push, pull_request] | |
| jobs: | |
| windows_386_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-i686-gcc | |
| mingw-w64-i686-toolchain | |
| mingw-w64-i686-pkg-config | |
| mingw-w64-i686-openssl | |
| base-devel | |
| autoconf | |
| automake | |
| libtool | |
| make | |
| unzip | |
| wget | |
| - name: Install YARA v4.5.5 (i386) | |
| 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=/mingw32 --host=i686-w64-mingw32 | |
| make -j$(nproc) | |
| make install | |
| - name: Set up Go | |
| uses: actions/setup-go@v2 | |
| with: | |
| go-version: 1.24 | |
| - uses: actions/checkout@v2 | |
| - name: Build FastFinder (i386) | |
| run: | | |
| # Use MinGW 32-bit environment | |
| export PATH="/mingw32/bin:$PATH" | |
| export PKG_CONFIG_PATH="/mingw32/lib/pkgconfig" | |
| export CGO_CFLAGS="-I/mingw32/include" | |
| export CGO_ENABLED=1 | |
| export GOOS=windows | |
| export GOARCH=386 | |
| export CGO_LDFLAGS="-L/mingw32/lib -lyara -lssl -lcrypto -lws2_32 -static" | |
| go build -v -ldflags "-s -w" -tags yara_static -o fastfinder-386.exe . | |
| ls -l fastfinder-386.exe | |
| ./fastfinder-386.exe -h |