File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -6,8 +6,8 @@ COMMIT=$(shell git rev-parse --short HEAD 2>/dev/null || echo "none")
66BUILD_TIME =$(shell date -u '+% Y-% m-% d_% H:% M:% S')
77LDFLAGS =-ldflags "-X main.version=$(VERSION ) -X main.commit=$(COMMIT ) "
88
9- # Apple code signing (set via environment or use default )
10- APPLE_DEVELOPER_ID ?= 9E5DE6F9BC4DF45371D1121683B21D1638CDB875
9+ # Apple code signing (set APPLE_DEVELOPER_ID env var to enable )
10+ # Example: APPLE_DEVELOPER_ID=YOUR_CERT_HASH make build-signed
1111
1212.PHONY : all build build-signed clean install test lint
1313
@@ -18,15 +18,17 @@ build:
1818 go build $(LDFLAGS ) -o $(BINARY_NAME ) .
1919
2020build-signed : build
21- @echo " Signing binary... "
22- @if [ " $$ (uname) " = " Darwin " ] ; then \
21+ @if [ " $$ (uname) " = " Darwin " ] && [ -n " $( APPLE_DEVELOPER_ID ) " ] ; then \
22+ echo " Signing binary... " ; \
2323 codesign --force --options runtime --sign " $( APPLE_DEVELOPER_ID) " $(BINARY_NAME ) ; \
2424 echo " Binary signed successfully" ; \
25+ elif [ " $$ (uname)" = " Darwin" ]; then \
26+ echo " Skipping code signing (set APPLE_DEVELOPER_ID to enable)" ; \
2527 else \
2628 echo " Skipping code signing (not macOS)" ; \
2729 fi
2830
29- install : build-signed
31+ install : build
3032 @echo " Installing to ~/.local/bin..."
3133 @mkdir -p ~ /.local/bin
3234 @cp $(BINARY_NAME ) ~ /.local/bin/$(BINARY_NAME )
Original file line number Diff line number Diff line change 55SCRIPT_DIR=" $( cd " $( dirname " ${BASH_SOURCE[0]} " ) " && pwd) "
66cd " $SCRIPT_DIR "
77
8- # Apple Code Signing Configuration
9- # Set these environment variables or they will use defaults
10- APPLE_DEVELOPER_ID=" ${APPLE_DEVELOPER_ID :- 9E5DE6F9BC4DF45371D1121683B21D1638CDB875} "
8+ # Apple Code Signing Configuration (optional)
9+ # Set APPLE_DEVELOPER_ID environment variable to enable signing
10+ # Example: export APPLE_DEVELOPER_ID="your-certificate-hash "
1111
1212echo " =========================================="
1313echo " Logdump Installation Script"
@@ -36,8 +36,8 @@ if ! go build -o logdump .; then
3636 exit 1
3737fi
3838
39- # Sign the binary (macOS only)
40- if [[ " $OSTYPE " == " darwin" * ]]; then
39+ # Sign the binary (macOS only, requires APPLE_DEVELOPER_ID )
40+ if [[ " $OSTYPE " == " darwin" * ]] && [[ -n " $APPLE_DEVELOPER_ID " ]] ; then
4141 echo " Signing binary with Developer ID..."
4242 if command -v codesign & > /dev/null; then
4343 codesign --force --options runtime --sign " $APPLE_DEVELOPER_ID " logdump
@@ -50,6 +50,8 @@ if [[ "$OSTYPE" == "darwin"* ]]; then
5050 else
5151 echo " Warning: codesign not found, skipping signing"
5252 fi
53+ elif [[ " $OSTYPE " == " darwin" * ]]; then
54+ echo " Skipping code signing (set APPLE_DEVELOPER_ID to enable)"
5355fi
5456
5557# Install binary
You can’t perform that action at this time.
0 commit comments