Add --skip-signing option

This commit is contained in:
Ryan Hughes committed 2025-08-28 23:04:48 +03:00
1 parent c57c9620de
commit c7b4bdd3a1
2 files changed
+21 -3

No files matched your search

+15 -1
View File
@@ -33,8 +33,16 @@ print_header "Omarchy AUR Package Builder"
# Parse command line arguments # Parse command line arguments
while [[ $# -gt 0 ]]; do while [[ $# -gt 0 ]]; do
case $1 in case $1 in
--skip-signing)
SKIP_SIGNING=true
shift
;;
-h | --help) -h | --help)
echo "Usage: $0" echo "Usage: $0 [OPTIONS]"
echo ""
echo "Options:"
echo " --skip-signing Build packages without GPG signing"
echo " -h, --help Show this help message"
echo "" echo ""
echo "This script builds AUR packages from:" echo "This script builds AUR packages from:"
echo " build/packages/omarchy-aur.packages" echo " build/packages/omarchy-aur.packages"
@@ -54,6 +62,10 @@ if [[ ! -f "$BUILD_DIR/packages/omarchy-aur.packages" ]]; then
exit 1 exit 1
fi fi
# Handle GPG signing setup
if [[ "$SKIP_SIGNING" == true ]]; then
print_warning "Skipping GPG signing (--skip-signing flag set)"
else
# Get GPG key from 1Password or environment for signing # Get GPG key from 1Password or environment for signing
if [[ -z "$GPG_PRIVATE_KEY" ]]; then if [[ -z "$GPG_PRIVATE_KEY" ]]; then
print_info "Fetching GPG signing key from 1Password..." print_info "Fetching GPG signing key from 1Password..."
@@ -78,6 +90,7 @@ else
fi fi
export GPG_PASSPHRASE export GPG_PASSPHRASE
print_success "GPG signing key and passphrase loaded" print_success "GPG signing key and passphrase loaded"
fi
# Build/update the Docker image # Build/update the Docker image
print_info "Building Docker image..." print_info "Building Docker image..."
@@ -87,6 +100,7 @@ print_info "Running AUR package build..."
# Build Docker arguments # Build Docker arguments
DOCKER_ARGS=( DOCKER_ARGS=(
--rm --rm
-e SKIP_SIGNING
-e GPG_PRIVATE_KEY -e GPG_PRIVATE_KEY
-e GPG_PASSPHRASE -e GPG_PASSPHRASE
-v "$ARCH_DIR:/output" -v "$ARCH_DIR:/output"
+6 -2
View File
@@ -3,7 +3,11 @@
echo "==> Importing GPG keys..." echo "==> Importing GPG keys..."
# Import signing key (required) # Check if signing is enabled
if [[ "$SKIP_SIGNING" == true ]]; then
echo " -> Skipping signing key import (--skip-signing enabled)"
else
# Import signing key (required for signing)
echo " -> Importing signing key..." echo " -> Importing signing key..."
# Import with batch mode and no tty for automated signing # Import with batch mode and no tty for automated signing
echo "$GPG_PRIVATE_KEY" | gpg --batch --import || { echo "$GPG_PRIVATE_KEY" | gpg --batch --import || {
@@ -39,6 +43,7 @@ else
echo " -> ERROR: Could not extract key ID" echo " -> ERROR: Could not extract key ID"
exit 1 exit 1
fi fi
fi
# Read the gpg-keys.txt file for verification keys # Read the gpg-keys.txt file for verification keys
if [[ -f /build/gpg-keys.txt ]]; then if [[ -f /build/gpg-keys.txt ]]; then
@@ -68,4 +73,3 @@ else
fi fi
echo " -> GPG setup complete" echo " -> GPG setup complete"