Add Windows optimized workflow

This commit is contained in:
Miepee
2024-05-30 12:56:21 +02:00
parent b9337ec7f6
commit 691a5e0baa
2 changed files with 47 additions and 0 deletions

View File

@@ -20,3 +20,18 @@ jobs:
with:
name: linux-x64-gui.zip
path: ./linux-x64.zip
windows:
runs-on: windows-latest
steps:
- uses: actions/checkout@v4
- name: Build
run: bash ./make-windows.sh
- name: Zip to Archive
run: 7z a -tzip ./windows-x64.zip ./flips.exe
- name: Upload Artifacts
uses: actions/upload-artifact@v4.3.1
with:
name: windows-x64-gui.zip
path: ./windows-x64.zip

32
make-windows.sh Normal file
View File

@@ -0,0 +1,32 @@
#!/bin/sh
# For whatever reason, Windows sometimes has LANG unset. This breaks grep at the end, so setting this manually.
export LANG=C.UTF-8
echo "This script creates a heavily optimized Windows binary. For debugging you're better off using the Makefile directly."
rm floating.zip
rm -r obj/* || true
#if trying to make a 32bit Flips, add -Wl,--large-address-aware
echo 'Windows (1/3)'
rm -r obj/* flips.exe; make CFLAGS="$FLAGS -fprofile-generate -lgcov"
[ -e flips.exe ] || exit
echo 'Windows (2/3)'
./flips.exe --create --bps-delta profile/firefox-10.0esr.tar profile/firefox-17.0esr.tar /dev/null
./flips.exe --create --bps-delta-moremem profile/firefox-10.0esr.tar profile/firefox-17.0esr.tar /dev/null
echo 'Windows (3/3)'
rm flips.exe; make CFLAGS="$FLAGS -fprofile-use -s"
# CI currently has invalid dependencies. Unsure if ok or not.
ERROR_CODE_ON_INVALID_DEPENDENCIES=1
if [ -z ${IGNORE_ON_INVALID_DEPENDENCIES} ]; then ERROR_CODE_ON_INVALID_DEPENDENCIES=0; fi
#verify that there are no unexpected dependencies
objdump -p flips.exe | grep 'DLL Name' | \
grep -Pvi '(msvcrt|advapi32|comctl32|comdlg32|gdi32|kernel32|shell32|user32)' && \
echo "Invalid dependency" && exit $ERROR_CODE_ON_INVALID_DEPENDENCIES