native macOS codings agent orchestrator
6
fork

Configure Feed

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

Simplify Sparkle key piping

khoi f1d8c53b f91701ee

+1 -31
+1 -31
.github/workflows/release.yml
··· 130 130 - run: | 131 131 STAGING=$(mktemp -d) 132 132 cp build/supacode.app.zip "$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() 137 - if "BEGIN" in key: 138 - key = re.sub(r"-----BEGIN[^-]*-----", "", key) 139 - key = re.sub(r"-----END[^-]*-----", "", key) 140 - key = re.sub(r"\s+", "", key) 141 - if not key: 142 - sys.exit("SPARKLE_PRIVATE_KEY is empty") 143 - if re.fullmatch(r"[0-9a-fA-F]{128}", key): 144 - raw = binascii.unhexlify(key) 145 - print(base64.b64encode(raw).decode()) 146 - sys.exit(0) 147 - def decode_b64(value): 148 - value = value.replace("-", "+").replace("_", "/") 149 - if len(value) % 4: 150 - value += "=" * (4 - (len(value) % 4)) 151 - try: 152 - return base64.b64decode(value, validate=True) 153 - except Exception: 154 - return None 155 - raw = decode_b64(key) 156 - if raw is None: 157 - sys.exit("SPARKLE_PRIVATE_KEY is not valid base64 or hex") 158 - if len(raw) not in (32, 64): 159 - sys.exit(f"SPARKLE_PRIVATE_KEY decoded length {len(raw)} is not 32 or 64") 160 - print(key) 161 - PY 162 - ) 163 - printf "%s" "$SPARKLE_KEY_B64" | ./bins/generate_appcast --download-url-prefix "https://github.com/$GITHUB_REPOSITORY/releases/download/$TAG/" --ed-key-file - "$STAGING" 133 + printf "%s" "$SPARKLE_PRIVATE_KEY" | tr -d '\r\n\t ' | ./bins/generate_appcast --download-url-prefix "https://github.com/$GITHUB_REPOSITORY/releases/download/$TAG/" --ed-key-file - "$STAGING" 164 134 cp "$STAGING/appcast.xml" build/appcast.xml 165 135 - run: | 166 136 NOTES_FILE=build/release-notes.txt