@@ -570,174 +570,4 @@ jobs:
570570 git commit -m "Update apps.json for ProSign v${VERSION}"
571571 echo "Pushing apps.json to ${PAGES_REPO}:main"
572572 git push "https://x-access-token:${PAGES_PAT}@github.com/${PAGES_REPO}.git" HEAD:main
573- shell : bash
574-
575- create-developer-update :
576- name : Create Developer Update
577- needs : build-unsigned-ipa
578- if : needs.build-unsigned-ipa.outputs.release_exists == 'true'
579- runs-on : ubuntu-latest
580- permissions :
581- contents : write
582- steps :
583- - name : Checkout Repo
584- uses : actions/checkout@v4
585- with :
586- fetch-depth : 0
587- persist-credentials : true
588-
589- - name : Install jq and GitHub CLI
590- run : |
591- sudo apt update
592- # jq
593- if ! command -v jq >/dev/null 2>&1; then
594- sudo apt install jq -y || true
595- fi
596- # gh
597- if ! command -v gh >/dev/null 2>&1; then
598- curl -fsSL https://cli.github.com/packages/githubcli-archive-keyring.gpg | sudo dd of=/usr/share/keyrings/githubcli-archive-keyring.gpg
599- 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
600- sudo apt update
601- sudo apt install gh -y || true
602- fi
603-
604- echo "jq: $(jq --version 2>/dev/null || echo 'not installed')"
605- echo "gh: $(gh --version 2>/dev/null || echo 'not installed')"
606-
607- - name : Download Device IPA
608- uses : actions/download-artifact@v4
609- with :
610- name : com.prostoreios.prosign-unsigned-ios.ipa
611- path : build
612-
613- - name : Handle Developer Release
614- env :
615- GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
616- run : |
617- set -e
618- DEVICE_IPA="build/com.prostoreios.prosign-unsigned-ios.ipa"
619- DEV_IPA="build/com.prostoreios.prosign-developer-unsigned-ios.ipa"
620- mv "$DEVICE_IPA" "$DEV_IPA"
621-
622- TAG="developer"
623- echo "Checking if release $TAG exists..."
624- if gh release view "$TAG" >/dev/null 2>&1; then
625- echo "Deleting existing $TAG release..."
626- gh release delete "$TAG" --yes
627- fi
628-
629- echo "Creating new developer release..."
630- gh release create "$TAG" \
631- "$DEV_IPA" \
632- --prerelease \
633- --title "Developer Update" \
634- --notes "" \
635- --repo "$GITHUB_REPOSITORY"
636-
637- - name : Update Developer Repo JSON
638- env :
639- GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
640- VERSION : ${{ needs.build-unsigned-ipa.outputs.version }}
641- run : |
642- set -e
643- REPO_FILE="developer-repo.json"
644- DOWNLOAD_URL="https://github.com/ProStore-iOS/ProSign/releases/download/developer/com.prostoreios.prosign-developer-unsigned-ios.ipa"
645-
646- # Function to increment patch version
647- increment_patch() {
648- local version="$1"
649- IFS='.' read -r major minor patch <<< "$version"
650- patch=$((patch + 1))
651- echo "${major}.${minor}.${patch}"
652- }
653-
654- BASE_DEV=$(increment_patch "$VERSION")
655-
656- # Determine new dev version
657- NEW_D=1
658- if [ -f "$REPO_FILE" ]; then
659- CURRENT_DEV=$(jq -r '.apps[0].version // ""' "$REPO_FILE")
660- if [[ $CURRENT_DEV =~ ^([0-9]+\.[0-9]+\.[0-9]+)d([0-9]+)$ ]]; then
661- CURRENT_BASE="${BASH_REMATCH[1]}"
662- CURRENT_D="${BASH_REMATCH[2]}"
663- if [ "$CURRENT_BASE" == "$BASE_DEV" ]; then
664- NEW_D=$((CURRENT_D + 1))
665- fi
666- fi
667- fi
668-
669- NEW_VERSION="${BASE_DEV}d${NEW_D}"
670-
671- # Create or update JSON (always replace with single version)
672- jq -n \
673- --arg name "ProSign Developer Repo" \
674- --arg appname "ProSign Developer" \
675- --arg devname "ProStore iOS" \
676- --arg bundleIdentifier "com.prostoreios.prosign" \
677- --arg description "The developer pre-release version of ProSign!" \
678- --arg iconURL "https://raw.githubusercontent.com/ProStore-iOS/ProSign/refs/heads/main/Sources/prosign/Assets.xcassets/AppIcon.appiconset/Icon-1024.png" \
679- --arg version "$NEW_VERSION" \
680- --arg url "$DOWNLOAD_URL" \
681- '{
682- "name": $name,
683- "apps": [
684- {
685- "name": $appname,
686- "version": $version,
687- "developerName": $devname,
688- "localizedDescription": $description,
689- "iconURL": $iconURL,
690- "bundleIdentifier": $bundleIdentifier,
691- "downloadURL": $url
692- }
693- ]
694- }' > "$REPO_FILE"
695-
696- # Safe commit & push
697- git config user.name "github-actions"
698- git config user.email "github-actions@github.com"
699- git add "$REPO_FILE"
700- git commit -m "Update ProSign developer repo to $NEW_VERSION" || echo "No changes to commit"
701-
702- git fetch origin main --quiet
703- if git rev-parse --verify origin/main >/dev/null 2>&1; then
704- if git rebase origin/main; then
705- echo "Rebase succeeded, pushing changes..."
706- git push origin HEAD:main
707- else
708- echo "Rebase failed — aborting rebase and skipping push."
709- git rebase --abort || true
710- fi
711- else
712- git push origin HEAD:main
713- fi
714-
715- - name : Push Developer JSON to GitHub Pages
716- env :
717- PAGES_PAT : ${{ secrets.PAGES_PAT }}
718- run : |
719- set -e
720- PAGES_REPO="ProStore-iOS/ProStore-iOS.github.io"
721- PAGES_DIR=$(mktemp -d)
722-
723- echo "Cloning pages repo (masked token)..."
724- git clone --depth 1 "https://x-access-token:${PAGES_PAT}@github.com/${PAGES_REPO}.git" "$PAGES_DIR"
725-
726- echo "Copying developer-repo.json -> developer.json in pages repo"
727- cp developer-repo.json "$PAGES_DIR/developer.json"
728-
729- cd "$PAGES_DIR"
730- git config user.name "github-actions[bot]"
731- git config user.email "github-actions[bot]@users.noreply.github.com"
732-
733- # Only commit if there's a change
734- git add developer.json
735- if git diff --quiet --cached; then
736- echo "No changes to developer.json — nothing to commit/push."
737- exit 0
738- fi
739-
740- git commit -m "Update developer JSON from ProSign developer build"
741- echo "Pushing developer.json to ${PAGES_REPO}:main"
742- git push "https://x-access-token:${PAGES_PAT}@github.com/${PAGES_REPO}.git" HEAD:main
743573 shell : bash
0 commit comments