Skip to content

Commit 045b801

Browse files
committed
fix: improve resource compilation fallback logic
1 parent 0d251a6 commit 045b801

File tree

1 file changed

+7
-11
lines changed

1 file changed

+7
-11
lines changed

.github/workflows/build-release.yml

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ jobs:
5757
# Remove 'v' prefix if present
5858
MAJOR=${MAJOR#v}
5959
60-
# Create resource file (works on Linux too with FPC)
60+
# Create resource file
6161
cat > filefind.rc << EOF
6262
#define VER_FILEVERSION $MAJOR,$MINOR,$PATCH,$BUILD
6363
#define VER_PRODUCTVERSION $MAJOR,$MINOR,$PATCH,$BUILD
@@ -94,19 +94,15 @@ jobs:
9494
END
9595
EOF
9696
97-
# Install windres for compiling resources on Linux
97+
# Try to compile resource file, but build without if it fails
98+
echo "Attempting to compile resources..."
9899
sudo apt-get install -y binutils-mingw-w64
99100
100-
# Compile resource file if windres is available, otherwise build without resources
101-
if command -v x86_64-w64-mingw32-windres >/dev/null 2>&1; then
102-
x86_64-w64-mingw32-windres filefind.rc filefind.res 2>/dev/null || echo "windres failed, building without resources"
103-
if [ -f filefind.res ]; then
104-
fpc -O2 -Xs -XX -CX -WR filefind.res filefind.lpr
105-
else
106-
fpc -O2 -Xs -XX -CX filefind.lpr
107-
fi
101+
if x86_64-w64-mingw32-windres filefind.rc filefind.res 2>/dev/null && [ -f filefind.res ]; then
102+
echo "Resources compiled successfully, building with version info"
103+
fpc -O2 -Xs -XX -CX -WR filefind.res filefind.lpr
108104
else
109-
echo "windres not available, building without resources"
105+
echo "Resource compilation failed, building without version info"
110106
fpc -O2 -Xs -XX -CX filefind.lpr
111107
fi
112108

0 commit comments

Comments
 (0)