Skip to content
This repository was archived by the owner on Mar 7, 2026. It is now read-only.

Commit ee49d13

Browse files
authored
Add GitHub release creation and JSON update steps
1 parent 17ec788 commit ee49d13

File tree

1 file changed

+136
-164
lines changed

1 file changed

+136
-164
lines changed

.github/workflows/build-ipa.yml

Lines changed: 136 additions & 164 deletions
Original file line numberDiff line numberDiff line change
@@ -465,167 +465,139 @@ jobs:
465465
name: signed-ipas
466466
path: signed-ipas/*.ipa
467467

468-
# create-github-release:
469-
# name: Create GitHub Release
470-
# needs: [build-unsigned-ipa, sign-ipas]
471-
# if: needs.build-unsigned-ipa.outputs.release_exists == 'false'
472-
# runs-on: ubuntu-latest
473-
# steps:
474-
# - name: Install GitHub CLI
475-
# run: |
476-
# # gh (GitHub CLI)
477-
# if ! command -v gh >/dev/null 2>&1; then
478-
# echo "gh not found — attempting official installer script"
479-
# curl -fsSL https://cli.github.com/packages/githubcli-archive-keyring.gpg | sudo dd of=/usr/share/keyrings/githubcli-archive-keyring.gpg
480-
# echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/githubcli-archive-keyring.gpg] https://cli.github.com/packages stable main" | sudo tee /etc/apt/sources.list.d/github-cli.list > /dev/null
481-
# sudo apt update
482-
# sudo apt install gh -y || true
483-
# fi
484-
#
485-
# echo "gh: $(gh --version 2>/dev/null || echo 'not installed')"
486-
#
487-
# - name: Download All Artifacts
488-
# uses: actions/download-artifact@v4
489-
# with:
490-
# path: artifacts
491-
#
492-
# - name: Create Release
493-
# env:
494-
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
495-
# VERSION: ${{ needs.build-unsigned-ipa.outputs.version }}
496-
# CHANGELOG: ${{ needs.build-unsigned-ipa.outputs.changelog }}
497-
# run: |
498-
# TAG="v$VERSION"
499-
# echo "Creating release $TAG with notes:"
500-
# printf '%s\n' "$CHANGELOG"
501-
#
502-
# # Find all IPAs
503-
# IPAS=$(find artifacts -type f -name '*.ipa' -print0 | xargs -0)
504-
#
505-
# if [ -z "$IPAS" ]; then
506-
# echo "No IPAs found to upload."
507-
# exit 1
508-
# fi
509-
#
510-
# gh release create "$TAG" \
511-
# $IPAS \
512-
# --title "ProStore v$VERSION" \
513-
# --notes "$CHANGELOG" \
514-
# --repo "$GITHUB_REPOSITORY"
515-
# shell: bash
516-
#
517-
# update-prostore-repo-json:
518-
# name: Update ProStore Repo JSON
519-
# needs: build-unsigned-ipa
520-
# if: needs.build-unsigned-ipa.outputs.release_exists == 'false'
521-
# runs-on: ubuntu-latest
522-
# env:
523-
# VERSION: ${{ needs.build-unsigned-ipa.outputs.version }}
524-
# CHANGELOG: ${{ needs.build-unsigned-ipa.outputs.changelog }}
525-
# steps:
526-
# - name: Install jq
527-
# run: |
528-
# # jq
529-
# if ! command -v jq >/dev/null 2>&1; then
530-
# echo "jq not found — attempting to install"
531-
# sudo apt update
532-
# sudo apt install jq -y || true
533-
# fi
534-
#
535-
# echo "jq: $(jq --version 2>/dev/null || echo 'not installed')"
536-
#
537-
# - name: Download Device IPA
538-
# uses: actions/download-artifact@v4
539-
# with:
540-
# name: com.prostoreios.prostore-unsigned-ios.ipa
541-
# path: build
542-
#
543-
# - name: Update Apps JSON in Pages Repo
544-
# env:
545-
# PAGES_PAT: ${{ secrets.PAGES_PAT }}
546-
# run: |
547-
# set -e
548-
# IPA_PATH="$PWD/build/com.prostoreios.prostore-unsigned-ios.ipa"
549-
# DOWNLOAD_URL="https://github.com/ProStore-iOS/ProStore/releases/download/v$VERSION/com.prostoreios.prostore-unsigned-ios.ipa"
550-
#
551-
# if [ -f "$IPA_PATH" ]; then
552-
# IPA_SIZE=$(stat -c%s "$IPA_PATH")
553-
# SHA256=$(sha256sum "$IPA_PATH" | awk '{print $1}')
554-
# else
555-
# IPA_SIZE=0
556-
# SHA256=""
557-
# fi
558-
#
559-
# VERSION_DATE_ISO=$(date -u +"%Y-%m-%dT%H:%M:%S%z")
560-
# MIN_OS="16.0"
561-
# FULL_DATE=$(date +%Y%m%d%H%M%S)
562-
#
563-
# ICON_URL="https://raw.githubusercontent.com/ProStore-iOS/ProStore-iOS.github.io/refs/heads/main/ProStore_icon.png"
564-
# BUNDLE="com.prostoreios.prostore"
565-
# META_DESC="The BEST alternative app store for iOS!"
566-
# DEVNAME="ProStore iOS"
567-
# SCREENSHOTS='["https://raw.githubusercontent.com/ProStore-iOS/ProStore/refs/heads/main/gallery/Screenshot1.png","https://raw.githubusercontent.com/ProStore-iOS/ProStore/refs/heads/main/gallery/Screenshot2.png","https://raw.githubusercontent.com/ProStore-iOS/ProStore/refs/heads/main/gallery/Screenshot3.png","https://raw.githubusercontent.com/ProStore-iOS/ProStore/refs/heads/main/gallery/Screenshot4.png","https://raw.githubusercontent.com/ProStore-iOS/ProStore/refs/heads/main/gallery/Screenshot5.png"]'
568-
#
569-
# PAGES_REPO="ProStore-iOS/ProStore-iOS.github.io"
570-
# PAGES_DIR=$(mktemp -d)
571-
#
572-
# echo "Cloning pages repo (masked token)..."
573-
# git clone --depth 1 "https://x-access-token:${PAGES_PAT}@github.com/${PAGES_REPO}.git" "$PAGES_DIR"
574-
#
575-
# cd "$PAGES_DIR"
576-
# REPO_FILE="apps.json"
577-
#
578-
# # Create base repo JSON if missing (first run only)
579-
# if [ ! -f "$REPO_FILE" ]; then
580-
# jq -n --arg icon "$ICON_URL" '{
581-
# name: "Official ProStore Repo",
582-
# identifier: "com.prostoreios.prostore.repo",
583-
# sourceURL: "https://ProStore-iOS.github.io/apps.json",
584-
# iconURL: $icon,
585-
# website: "https://ProStore-iOS.github.io",
586-
# subtitle: "The BEST alternative app store for iOS!",
587-
# apps: []
588-
# }' > "$REPO_FILE"
589-
# fi
590-
#
591-
# TMP=$(mktemp)
592-
#
593-
# # Build the JSON representation of the new version (on one line to avoid parser issues)
594-
# NEW_VERSION=$(jq -c -n \
595-
# --arg version "$VERSION" \
596-
# --arg date "$VERSION_DATE_ISO" \
597-
# --arg desc "$CHANGELOG" \
598-
# --arg url "$DOWNLOAD_URL" \
599-
# --arg sha "$SHA256" \
600-
# --arg minos "$MIN_OS" \
601-
# --arg fulldate "$FULL_DATE" \
602-
# --argjson size "$IPA_SIZE" \
603-
# '{version: $version, date: $date, localizedDescription: $desc, downloadURL: $url, size: $size, sha256: $sha, minOSVersion: $minos, fullDate: $fulldate}')
604-
#
605-
# # Single-line jq filter (YAML-friendly, with .apps //= [] for robustness)
606-
# JQ_QUERY='(.apps //= []) | if ( .apps | map(.bundleIdentifier // .bundleID) | index($bundle) ) then .apps |= map( if ((.bundleIdentifier // .bundleID) == $bundle) then ( { "name": $name, "bundleIdentifier": $bundle, "developerName": $dev, "localizedDescription": $appdesc, "iconURL": $icon, "screenshotURLs": $screenshots } + { "versions": ( [ $newVer ] + ( .versions // [] ) ) } ) else . end ) else .apps += [ { "name": $name, "bundleIdentifier": $bundle, "developerName": $dev, "localizedDescription": $appdesc, "iconURL": $icon, "screenshotURLs": $screenshots, "versions": [ $newVer ] } ] end'
607-
#
608-
# # Update or create the app entry (pass screenshots as argjson directly)
609-
# jq --argjson newVer "$NEW_VERSION" \
610-
# --arg name "ProStore" \
611-
# --arg bundle "$BUNDLE" \
612-
# --arg dev "$DEVNAME" \
613-
# --arg appdesc "$META_DESC" \
614-
# --arg icon "$ICON_URL" \
615-
# --argjson screenshots "$SCREENSHOTS" \
616-
# "$JQ_QUERY" "$REPO_FILE" > "$TMP" && mv "$TMP" "$REPO_FILE"
617-
#
618-
# git config user.name "github-actions[bot]"
619-
# git config user.email "github-actions[bot]@users.noreply.github.com"
620-
#
621-
# # Only commit if there's a change
622-
# git add "$REPO_FILE"
623-
# if git diff --quiet --cached; then
624-
# echo "No changes to apps.json — nothing to commit/push."
625-
# exit 0
626-
# fi
627-
#
628-
# git commit -m "Update apps.json for ProStore v${VERSION}"
629-
# echo "Pushing apps.json to ${PAGES_REPO}:main"
630-
# git push "https://x-access-token:${PAGES_PAT}@github.com/${PAGES_REPO}.git" HEAD:main
631-
# shell: bash
468+
create-github-release:
469+
name: Create GitHub Release
470+
needs: [build-unsigned-ipa, sign-ipas]
471+
if: needs.build-unsigned-ipa.outputs.release_exists == 'false'
472+
runs-on: ubuntu-latest
473+
steps:
474+
- name: Install GitHub CLI
475+
run: |
476+
if ! command -v gh >/dev/null 2>&1; then
477+
echo "gh not found — attempting official installer script"
478+
curl -fsSL https://cli.github.com/packages/githubcli-archive-keyring.gpg | sudo dd of=/usr/share/keyrings/githubcli-archive-keyring.gpg
479+
echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/githubcli-archive-keyring.gpg] https://cli.github.com/packages stable main" | sudo tee /etc/apt/sources.list.d/github-cli.list > /dev/null
480+
sudo apt update
481+
sudo apt install gh -y || true
482+
fi
483+
echo "gh: $(gh --version 2>/dev/null || echo 'not installed')"
484+
485+
- name: Download All Artifacts
486+
uses: actions/download-artifact@v4
487+
with:
488+
path: artifacts
489+
490+
- name: Create Release
491+
env:
492+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
493+
VERSION: ${{ needs.build-unsigned-ipa.outputs.version }}
494+
CHANGELOG: ${{ needs.build-unsigned-ipa.outputs.changelog }}
495+
run: |
496+
TAG="v$VERSION"
497+
echo "Creating release $TAG with notes:"
498+
printf '%s\n' "$CHANGELOG"
499+
IPAS=$(find artifacts -type f -name '*.ipa' -print0 | xargs -0)
500+
if [ -z "$IPAS" ]; then
501+
echo "No IPAs found to upload."
502+
exit 1
503+
fi
504+
gh release create "$TAG" \
505+
$IPAS \
506+
--title "ProStore v$VERSION" \
507+
--notes "$CHANGELOG" \
508+
--repo "$GITHUB_REPOSITORY"
509+
shell: bash
510+
511+
update-prostore-repo-json:
512+
name: Update ProStore Repo JSON
513+
needs: build-unsigned-ipa
514+
if: needs.build-unsigned-ipa.outputs.release_exists == 'false'
515+
runs-on: ubuntu-latest
516+
env:
517+
VERSION: ${{ needs.build-unsigned-ipa.outputs.version }}
518+
CHANGELOG: ${{ needs.build-unsigned-ipa.outputs.changelog }}
519+
steps:
520+
- name: Install jq
521+
run: |
522+
if ! command -v jq >/dev/null 2>&1; then
523+
echo "jq not found — attempting to install"
524+
sudo apt update
525+
sudo apt install jq -y || true
526+
fi
527+
echo "jq: $(jq --version 2>/dev/null || echo 'not installed')"
528+
529+
- name: Download Device IPA
530+
uses: actions/download-artifact@v4
531+
with:
532+
name: com.prostoreios.prostore-unsigned-ios.ipa
533+
path: build
534+
535+
- name: Update Apps JSON in Pages Repo
536+
env:
537+
PAGES_PAT: ${{ secrets.PAGES_PAT }}
538+
run: |
539+
set -e
540+
IPA_PATH="$PWD/build/com.prostoreios.prostore-unsigned-ios.ipa"
541+
DOWNLOAD_URL="https://github.com/ProStore-iOS/ProStore/releases/download/v$VERSION/com.prostoreios.prostore-unsigned-ios.ipa"
542+
if [ -f "$IPA_PATH" ]; then
543+
IPA_SIZE=$(stat -c%s "$IPA_PATH")
544+
SHA256=$(sha256sum "$IPA_PATH" | awk '{print $1}')
545+
else
546+
IPA_SIZE=0
547+
SHA256=""
548+
fi
549+
VERSION_DATE_ISO=$(date -u +"%Y-%m-%dT%H:%M:%S%z")
550+
MIN_OS="16.0"
551+
FULL_DATE=$(date +%Y%m%d%H%M%S)
552+
ICON_URL="https://raw.githubusercontent.com/ProStore-iOS/ProStore-iOS.github.io/refs/heads/main/ProStore_icon.png"
553+
BUNDLE="com.prostoreios.prostore"
554+
META_DESC="The BEST alternative app store for iOS!"
555+
DEVNAME="ProStore iOS"
556+
SCREENSHOTS='["https://raw.githubusercontent.com/ProStore-iOS/ProStore/refs/heads/main/gallery/Screenshot1.png","https://raw.githubusercontent.com/ProStore-iOS/ProStore/refs/heads/main/gallery/Screenshot2.png","https://raw.githubusercontent.com/ProStore-iOS/ProStore/refs/heads/main/gallery/Screenshot3.png","https://raw.githubusercontent.com/ProStore-iOS/ProStore/refs/heads/main/gallery/Screenshot4.png","https://raw.githubusercontent.com/ProStore-iOS/ProStore/refs/heads/main/gallery/Screenshot5.png"]'
557+
PAGES_REPO="ProStore-iOS/ProStore-iOS.github.io"
558+
PAGES_DIR=$(mktemp -d)
559+
git clone --depth 1 "https://x-access-token:${PAGES_PAT}@github.com/${PAGES_REPO}.git" "$PAGES_DIR"
560+
cd "$PAGES_DIR"
561+
REPO_FILE="apps.json"
562+
if [ ! -f "$REPO_FILE" ]; then
563+
jq -n --arg icon "$ICON_URL" '{
564+
name: "Official ProStore Repo",
565+
identifier: "com.prostoreios.prostore.repo",
566+
sourceURL: "https://ProStore-iOS.github.io/apps.json",
567+
iconURL: $icon,
568+
website: "https://ProStore-iOS.github.io",
569+
subtitle: "The BEST alternative app store for iOS!",
570+
apps: []
571+
}' > "$REPO_FILE"
572+
fi
573+
TMP=$(mktemp)
574+
NEW_VERSION=$(jq -c -n \
575+
--arg version "$VERSION" \
576+
--arg date "$VERSION_DATE_ISO" \
577+
--arg desc "$CHANGELOG" \
578+
--arg url "$DOWNLOAD_URL" \
579+
--arg sha "$SHA256" \
580+
--arg minos "$MIN_OS" \
581+
--arg fulldate "$FULL_DATE" \
582+
--argjson size "$IPA_SIZE" \
583+
'{version: $version, date: $date, localizedDescription: $desc, downloadURL: $url, size: $size, sha256: $sha, minOSVersion: $minos, fullDate: $fulldate}')
584+
JQ_QUERY='(.apps //= []) | if ( .apps | map(.bundleIdentifier // .bundleID) | index($bundle) ) then .apps |= map( if ((.bundleIdentifier // .bundleID) == $bundle) then ( { "name": $name, "bundleIdentifier": $bundle, "developerName": $dev, "localizedDescription": $appdesc, "iconURL": $icon, "screenshotURLs": $screenshots } + { "versions": ( [ $newVer ] + ( .versions // [] ) ) } ) else . end ) else .apps += [ { "name": $name, "bundleIdentifier": $bundle, "developerName": $dev, "localizedDescription": $appdesc, "iconURL": $icon, "screenshotURLs": $screenshots, "versions": [ $newVer ] } ] end'
585+
jq --argjson newVer "$NEW_VERSION" \
586+
--arg name "ProStore" \
587+
--arg bundle "$BUNDLE" \
588+
--arg dev "$DEVNAME" \
589+
--arg appdesc "$META_DESC" \
590+
--arg icon "$ICON_URL" \
591+
--argjson screenshots "$SCREENSHOTS" \
592+
"$JQ_QUERY" "$REPO_FILE" > "$TMP" && mv "$TMP" "$REPO_FILE"
593+
git config user.name "github-actions[bot]"
594+
git config user.email "github-actions[bot]@users.noreply.github.com"
595+
git add "$REPO_FILE"
596+
if git diff --quiet --cached; then
597+
echo "No changes to apps.json — nothing to commit/push."
598+
exit 0
599+
fi
600+
git commit -m "Update apps.json for ProStore v${VERSION}"
601+
echo "Pushing apps.json to ${PAGES_REPO}:main"
602+
git push "https://x-access-token:${PAGES_PAT}@github.com/${PAGES_REPO}.git" HEAD:main
603+
shell: bash

0 commit comments

Comments
 (0)