Skip to content

Commit 85efbfd

Browse files
Fix Sparkle key generation to use correct syntax from latest documentation
- Use ./bin/generate_keys without flags to generate new keys (saves to keychain, outputs public key) - Use -x flag to export existing private key from keychain to file - Follow official Sparkle documentation for proper key generation workflow - Fix 'Process completed with exit code 1' error in key generation - Ensure proper Sparkle key generation in CI/CD pipeline using latest version
1 parent dbbc953 commit 85efbfd

1 file changed

Lines changed: 15 additions & 19 deletions

File tree

.github/workflows/build-and-release.yml

Lines changed: 15 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -205,34 +205,30 @@ jobs:
205205
echo "📁 Available Sparkle tools:"
206206
ls -la ./bin/
207207
208-
# Generate new private key (output goes to stdout, redirect to file)
209-
./bin/generate_keys > keys/ed25519_private_key.pem
208+
# Generate new private key and get public key (saves to keychain, outputs public key)
209+
echo "🔑 Generating new private key and extracting public key..."
210+
PUBLIC_KEY=$(./bin/generate_keys)
210211
211-
# Verify private key was created
212-
if [ ! -f "keys/ed25519_private_key.pem" ] || [ ! -s "keys/ed25519_private_key.pem" ]; then
213-
echo "❌ Failed to generate private key"
212+
# Verify public key was generated
213+
if [ -z "$PUBLIC_KEY" ]; then
214+
echo "❌ Failed to generate keys"
214215
exit 1
215216
fi
216217
217-
echo "✅ Private key generated successfully"
218+
echo "✅ Keys generated successfully"
219+
echo "Public key: $PUBLIC_KEY"
218220
219-
# Extract public key from private key
220-
echo "🔑 Extracting public key from private key..."
221-
./bin/generate_keys -p keys/ed25519_private_key.pem > keys/ed25519_public_key.pem
221+
# Export private key to file for later use
222+
echo "🔑 Exporting private key to file..."
223+
./bin/generate_keys -x keys/ed25519_private_key.pem
222224
223-
# Verify public key was created
224-
if [ ! -f "keys/ed25519_public_key.pem" ] || [ ! -s "keys/ed25519_public_key.pem" ]; then
225-
echo "❌ Failed to extract public key"
226-
echo "📁 Contents of keys directory:"
227-
ls -la keys/
228-
echo "📄 Private key file size:"
229-
ls -la keys/ed25519_private_key.pem
225+
# Verify private key file was created
226+
if [ ! -f "keys/ed25519_private_key.pem" ] || [ ! -s "keys/ed25519_private_key.pem" ]; then
227+
echo "❌ Failed to export private key"
230228
exit 1
231229
fi
232230
233-
echo "✅ Public key extracted successfully"
234-
PUBLIC_KEY=$(grep -v "BEGIN\|END" keys/ed25519_public_key.pem | tr -d '\n')
235-
echo "Public key: $PUBLIC_KEY"
231+
echo "✅ Private key exported successfully"
236232
237233
# Update Info.plist with public key
238234
plutil -replace SUPublicEDSAKey -string "$PUBLIC_KEY" A6Cutter/Info.plist

0 commit comments

Comments
 (0)