native macOS codings agent orchestrator
6
fork

Configure Feed

Select the types of activity you want to include in your feed.

Normalize Sparkle ed25519 key before appcast

khoi 6f162174 1cd967bf

+20 -1
+20 -1
.github/workflows/release.yml
··· 130 130 - run: | 131 131 STAGING=$(mktemp -d) 132 132 cp build/supacode.app.zip "$STAGING/" 133 - printf "%s" "$SPARKLE_PRIVATE_KEY" | ./bins/generate_appcast --download-url-prefix "https://github.com/$GITHUB_REPOSITORY/releases/download/$TAG/" --ed-key-file - "$STAGING" 133 + SPARKLE_KEY_B64=$(python3 - <<'PY' 134 + import os, base64, re, binascii, sys 135 + key = os.environ.get("SPARKLE_PRIVATE_KEY", "") 136 + key = key.strip().replace("\n", "").replace("\r", "") 137 + if not key: 138 + sys.exit("SPARKLE_PRIVATE_KEY is empty") 139 + if re.fullmatch(r"[0-9a-fA-F]{128}", key): 140 + raw = binascii.unhexlify(key) 141 + print(base64.b64encode(raw).decode()) 142 + sys.exit(0) 143 + try: 144 + raw = base64.b64decode(key, validate=True) 145 + except Exception: 146 + sys.exit("SPARKLE_PRIVATE_KEY is not valid base64 or hex") 147 + if len(raw) not in (32, 64): 148 + sys.exit(f"SPARKLE_PRIVATE_KEY decoded length {len(raw)} is not 32 or 64") 149 + print(key) 150 + PY 151 + ) 152 + printf "%s" "$SPARKLE_KEY_B64" | ./bins/generate_appcast --download-url-prefix "https://github.com/$GITHUB_REPOSITORY/releases/download/$TAG/" --ed-key-file - "$STAGING" 134 153 cp "$STAGING/appcast.xml" build/appcast.xml 135 154 - run: | 136 155 NOTES_FILE=build/release-notes.txt