@@ -203,58 +203,64 @@ jobs:
203203 asset_name : ${{ env.LNAV_ZIPNAME }}
204204 asset_content_type : application/octet-stream
205205
206- build-windows-on-linux :
207- name : Build Windows Binary (Static)
208- runs-on : ubuntu-latest
206+ build-windows-msys2 :
207+ runs-on : windows-latest
208+
209+ defaults :
210+ run :
211+ shell : msys2 {0}
209212
210213 steps :
211- - name : Checkout code
214+ - name : Checkout source
212215 uses : actions/checkout@v4
213216
214- - name : Install dependencies
215- run : |
216- sudo apt update
217- sudo apt install -y \
218- mingw-w64 \
219- cmake \
220- make \
221- pkg-config \
222- zip \
223- autoconf \
224- automake \
225- libtool \
226- gettext
217+ - name : Set up MSYS2
218+ uses : msys2/setup-msys2@v2
219+ with :
220+ msystem : MINGW64
221+ update : true
222+ install : >-
223+ base-devel
224+ git
225+ mingw-w64-x86_64-toolchain
226+ mingw-w64-x86_64-libarchive
227+ mingw-w64-x86_64-libbz2
228+ mingw-w64-x86_64-sqlite3
229+ mingw-w64-x86_64-libunistring
230+ mingw-w64-x86_64-pkg-config
231+ autotools
232+ zip
233+
234+ - name : Bootstrap Autotools
235+ run : ./autogen.sh
227236
228- - name : Configure & Build
237+ - name : Configure with SQLite
238+ env :
239+ CC : gcc
240+ CXX : g++
241+ PKG_CONFIG_PATH : /mingw64/lib/pkgconfig
229242 run : |
230- set -x
231- ./autogen.sh
232- mkdir build
233- cd build
234- ../configure \
235- --host=x86_64-w64-mingw32 \
236- --enable-static \
237- LDFLAGS="-static" \
238- CPPFLAGS="-O2" \
239- CXXFLAGS="-fPIC" \
240- CFLAGS="-fPIC" \
241- LIBS="-larchive -lssh2 -llzma -lexpat -llz4 -lz -lzstd -lssl -lcrypto -liconv -lunistring -lbrotlicommon -lcrypt32" \
242- --sysconfdir=/etc \
243- --prefix=$PREFIX || cat config.log
243+ ./configure \
244+ --prefix=/mingw64 \
245+ --enable-static \
246+ --disable-shared \
247+ --with-sqlite3 \
248+ --with-editline
244249
245250 - name : Build
246- run : |
247- make -j$(nproc)
251+ run : make V=1
252+
253+ - name : Strip binary
254+ run : strip src/lnav.exe || true
248255
249256 - name : Package
250- run : |
251- zip -j lnav-windows2.zip build/lnav.exe
257+ run : zip -j lnav-windows-msys2.zip src/lnav.exe
252258
253- - name : Upload artifact
259+ - name : Upload binary
254260 uses : actions/upload-artifact@v4
255261 with :
256- name : lnav-windows2
257- path : lnav-windows2 .zip
262+ name : lnav-windows-msys2
263+ path : lnav-windows-msys2 .zip
258264
259265 build-windows :
260266 runs-on : windows-latest
0 commit comments