Skip to content

Commit ade16b7

Browse files
committed
Enhance GitHub Actions workflow for macOS code signing by adding GNU coreutils installation for timeout command compatibility. Implemented conditional logic to use gtimeout or timeout based on availability, improving reliability of signing attempts.
1 parent 6616b44 commit ade16b7

1 file changed

Lines changed: 12 additions & 2 deletions

File tree

.github/workflows/release.yml

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -195,13 +195,23 @@ jobs:
195195
# Sign with proper Developer ID certificate, hardened runtime, and timestamp
196196
echo "=== Signing binary with hardened runtime ==="
197197
198+
# Install GNU coreutils for timeout command (macOS compatibility)
199+
if ! command -v timeout &> /dev/null; then
200+
echo "Installing GNU coreutils for timeout command..."
201+
brew install coreutils
202+
# Use gtimeout from coreutils
203+
TIMEOUT_CMD="gtimeout"
204+
else
205+
TIMEOUT_CMD="timeout"
206+
fi
207+
198208
# Add timeout and retry logic for signing to prevent hanging
199209
SIGN_SUCCESS=false
200210
for attempt in 1 2 3; do
201211
echo "Signing attempt $attempt/3..."
202212
203213
# Use timeout command to prevent hanging (max 5 minutes per attempt)
204-
if timeout 300 codesign --force \
214+
if $TIMEOUT_CMD 300 codesign --force \
205215
--options runtime \
206216
--entitlements scripts/entitlements.plist \
207217
--sign "${CERT_IDENTITY}" \
@@ -225,7 +235,7 @@ jobs:
225235
226236
# Try signing without timestamp as fallback
227237
echo "Attempting fallback signing without timestamp..."
228-
if timeout 120 codesign --force \
238+
if $TIMEOUT_CMD 120 codesign --force \
229239
--options runtime \
230240
--entitlements scripts/entitlements.plist \
231241
--sign "${CERT_IDENTITY}" \

0 commit comments

Comments
 (0)