@@ -447,79 +447,66 @@ jobs:
447447 BUNDLE="com.prostoreios.prosign"
448448 META_DESC="The BEST alternative app store for iOS!"
449449 DEVNAME="ProStore iOS"
450- SCREENSHOTS='[
451- "https://raw.githubusercontent.com/ProStore-iOS/ProSign/refs/heads/main/gallery/Screenshot1.png",
452- "https://raw.githubusercontent.com/ProStore-iOS/ProSign/refs/heads/main/gallery/Screenshot2.png",
453- "https://raw.githubusercontent.com/ProStore-iOS/ProSign/refs/heads/main/gallery/Screenshot3.png",
454- "https://raw.githubusercontent.com/ProStore-iOS/ProSign/refs/heads/main/gallery/Screenshot4.png",
455- "https://raw.githubusercontent.com/ProStore-iOS/ProSign/refs/heads/main/gallery/Screenshot5.png"
456- ]'
457-
458- # Ensure base repo JSON exists
450+ SCREENSHOTS='["https://raw.githubusercontent.com/ProStore-iOS/ProSign/refs/heads/main/gallery/Screenshot1.png","https://raw.githubusercontent.com/ProStore-iOS/ProSign/refs/heads/main/gallery/Screenshot2.png","https://raw.githubusercontent.com/ProStore-iOS/ProSign/refs/heads/main/gallery/Screenshot3.png","https://raw.githubusercontent.com/ProStore-iOS/ProSign/refs/heads/main/gallery/Screenshot4.png","https://raw.githubusercontent.com/ProStore-iOS/ProSign/refs/heads/main/gallery/Screenshot5.png"]'
451+
452+ # Ensure base repo JSON exists (matches your example, with expansion for $ICON_URL)
459453 if [ ! -f "$REPO_FILE" ]; then
460- echo '{
461- "name": "Official ProStore Repo",
462- "identifier": "com.prostoreios.prostore.repo",
463- "sourceURL": "https://ProStore-iOS.github.io/apps.json",
464- "iconURL": "'"$ICON_URL"'",
465- "website": "https://ProStore-iOS.github.io",
466- "ipawebsite": "https://github.com/ProStore-iOS/ProStore/releases",
467- "subtitle": "The BEST alternative app store for iOS!",
468- "META": {
469- "repoName": "Official ProStore Repo",
470- "repoIcon": "'"$ICON_URL"'"
471- },
472- "apps": []
473- }' > "$REPO_FILE"
454+ cat > "$REPO_FILE" <<EOF
455+ {
456+ " name " : " Official ProStore Repo" ,
457+ " identifier " : " com.prostoreios.prostore.repo" ,
458+ " sourceURL " : " https://ProStore-iOS.github.io/apps.json" ,
459+ " iconURL " : " $ICON_URL" ,
460+ " website " : " https://ProStore-iOS.github.io" ,
461+ " subtitle " : " The BEST alternative app store for iOS!" ,
462+ " apps " : []
463+ }
464+ EOF
474465 fi
475466
476467 TMP=$(mktemp)
477468
478- # Build the JSON representation of the new version
479- NEW_VERSION=$(jq -c -n \
480- --arg version "$VERSION" \
481- --arg date "$VERSION_DATE_ISO" \
482- --arg desc "$CHANGELOG" \
483- --arg url "$DOWNLOAD_URL" \
484- --arg sha "$SHA256" \
485- --arg minos "$MIN_OS" \
486- --argjson size "$IPA_SIZE" \
487- --arg fulldate "$FULL_DATE" \
488- '{version: $version, date: $date, localizedDescription: $desc, downloadURL: $url, size: $size, sha256: $sha, minOSVersion: $minos, fullDate: $fulldate}')
489-
490- # Update or create the app entry
469+ # Build the JSON representation of the new version (on one line to avoid parser issues)
470+ NEW_VERSION=$(jq -c -n --arg version "$VERSION" --arg date "$VERSION_DATE_ISO" --arg desc "$CHANGELOG" --arg url "$DOWNLOAD_URL" --arg sha "$SHA256" --arg minos "$MIN_OS" --arg fulldate "$FULL_DATE" --argjson size "$IPA_SIZE" '{version : $version, date: $date, localizedDescription: $desc, downloadURL: $url, size: $size, sha256: $sha, minOSVersion: $minos, fullDate: $fulldate}')
471+
472+ # JQ query with indented content to avoid YAML parser confusion
473+ read -r -d '' JQ_QUERY <<'EOF'
474+ if ( .apps | map(.bundleIdentifier // .bundleID) | index($bundle) ) then
475+ .apps |= map(
476+ if ((.bundleIdentifier // .bundleID) == $bundle) then
477+ ( { "name" : $name,
478+ " bundleIdentifier " : $bundle,
479+ " developerName " : $dev,
480+ " localizedDescription " : $appdesc,
481+ " iconURL " : $icon,
482+ " screenshotURLs " : $screenshots
483+ } + { "versions" : ( [ $newVer ] + ( .versions // [] ) ) } )
484+ else . end
485+ )
486+ else
487+ .apps += [
488+ {
489+ " name " : $name,
490+ " bundleIdentifier " : $bundle,
491+ " developerName " : $dev,
492+ " localizedDescription " : $appdesc,
493+ " iconURL " : $icon,
494+ " screenshotURLs " : $screenshots,
495+ " versions " : [ $newVer ]
496+ }
497+ ]
498+ end
499+ EOF
500+
501+ # Update or create the app entry (pass screenshots as argjson directly)
491502 jq --argjson newVer "$NEW_VERSION" \
492503 --arg name "ProSign" \
493504 --arg bundle "$BUNDLE" \
494505 --arg dev "$DEVNAME" \
495- --arg desc "$META_DESC" \
506+ --arg appdesc "$META_DESC" \
496507 --arg icon "$ICON_URL" \
497508 --argjson screenshots "$SCREENSHOTS" \
498- 'if ( .apps | map(.bundleIdentifier // .bundleID) | index($bundle) ) then
499- .apps |= map(
500- if ((.bundleIdentifier // .bundleID) == $bundle) then
501- ( { "name": $name,
502- "bundleIdentifier": $bundle,
503- "developerName": $dev,
504- "localizedDescription": $desc,
505- "iconURL": $icon,
506- "screenshotURLs": $screenshots
507- } + { "versions": ( [ $newVer ] + ( .versions // [] ) ) } )
508- else . end
509- )
510- else
511- .apps += [
512- {
513- "name": $name,
514- "bundleIdentifier": $bundle,
515- "developerName": $dev,
516- "localizedDescription": $desc,
517- "iconURL": $icon,
518- "screenshotURLs": $screenshots,
519- "versions": [ $newVer ]
520- }
521- ]
522- end' "$REPO_FILE" > "$TMP" && mv "$TMP" "$REPO_FILE"
509+ " $JQ_QUERY" " $REPO_FILE" > "$TMP" && mv "$TMP" "$REPO_FILE"
523510
524511 # Safe commit & push
525512 git config user.name "github-actions"
0 commit comments