Skip to content

Commit 5dc50e2

Browse files
authored
Update build-ipa.yml
1 parent 3bd5aab commit 5dc50e2

File tree

1 file changed

+62
-62
lines changed

1 file changed

+62
-62
lines changed

.github/workflows/build-ipa.yml

Lines changed: 62 additions & 62 deletions
Original file line numberDiff line numberDiff line change
@@ -325,87 +325,87 @@ jobs:
325325
with:
326326
name: com.prostoreios.prostore-unsigned-ios.ipa
327327
path: build
328-
- name: Fetch Certificates List and Sign
329-
run: |
330-
set -euo pipefail
328+
- name: Fetch Certificates List and Sign
329+
run: |
330+
set -euo pipefail
331331
332-
UNSIGNED_IPA="build/com.prostoreios.prostore-unsigned-ios.ipa"
333-
if [ ! -f "$UNSIGNED_IPA" ]; then
334-
echo "ERROR: Unsigned IPA not found: $UNSIGNED_IPA"
335-
exit 1
336-
fi
332+
UNSIGNED_IPA="build/com.prostoreios.prostore-unsigned-ios.ipa"
333+
if [ ! -f "$UNSIGNED_IPA" ]; then
334+
echo "ERROR: Unsigned IPA not found: $UNSIGNED_IPA"
335+
exit 1
336+
fi
337337
338-
# Fetch README.md that lists signed certs
339-
curl -s https://raw.githubusercontent.com/ProStore-iOS/certificates/refs/heads/main/README.md > readme.md
338+
# Fetch README.md that lists signed certs
339+
curl -s https://raw.githubusercontent.com/ProStore-iOS/certificates/refs/heads/main/README.md > readme.md
340340
341-
# Extract signed certificate full names (line format in your README)
342-
FULL_NAMES=$(grep -F '| **✅ Signed** |' readme.md | awk -F'|' '{gsub(/^\s+|\s+$/,"",$2); print $2}')
341+
# Extract signed certificate full names (line format in your README)
342+
FULL_NAMES=$(grep -F '| **✅ Signed** |' readme.md | awk -F'|' '{gsub(/^\s+|\s+$/,"",$2); print $2}')
343343
344-
if [ -z "$FULL_NAMES" ]; then
345-
echo "No signed certificates found. Skipping signing."
346-
exit 0
347-
fi
344+
if [ -z "$FULL_NAMES" ]; then
345+
echo "No signed certificates found. Skipping signing."
346+
exit 0
347+
fi
348348
349-
# Install zsign dependencies
350-
brew install pkg-config openssl minizip
349+
# Install zsign dependencies
350+
brew install pkg-config openssl minizip
351351
352-
# Build zsign
353-
git clone https://github.com/zhlynn/zsign.git
354-
cd zsign/build/macos
355-
make clean && make
352+
# Build zsign
353+
git clone https://github.com/zhlynn/zsign.git
354+
cd zsign/build/macos
355+
make clean && make
356356
357-
# Find the built zsign binary (most zsign builds place it in zsign/bin/zsign)
358-
cd ../../..
359-
ZSIGN_PATH="$(pwd)/zsign/bin/zsign"
357+
# Find the built zsign binary (most zsign builds place it in zsign/bin/zsign)
358+
cd ../../..
359+
ZSIGN_PATH="$(pwd)/zsign/bin/zsign"
360360
361-
# As a fallback, try to locate if not found
362-
if [ ! -x "$ZSIGN_PATH" ]; then
363-
echo "Expected binary not found at $ZSIGN_PATH, searching..."
364-
FOUND=$(find "$(pwd)/zsign" -type f -name zsign -perm -111 -print -quit || true)
365-
if [ -n "$FOUND" ]; then
366-
ZSIGN_PATH="$FOUND"
367-
else
368-
echo "zsign binary not found. Listing zsign tree:"
369-
ls -la zsign || true
370-
exit 1
361+
# As a fallback, try to locate if not found
362+
if [ ! -x "$ZSIGN_PATH" ]; then
363+
echo "Expected binary not found at $ZSIGN_PATH, searching..."
364+
FOUND=$(find "$(pwd)/zsign" -type f -name zsign -perm -111 -print -quit || true)
365+
if [ -n "$FOUND" ]; then
366+
ZSIGN_PATH="$FOUND"
367+
else
368+
echo "zsign binary not found. Listing zsign tree:"
369+
ls -la zsign || true
370+
exit 1
371+
fi
371372
fi
372-
fi
373373
374-
echo "Using zsign at: $ZSIGN_PATH"
375-
ls -l "$ZSIGN_PATH" || true
374+
echo "Using zsign at: $ZSIGN_PATH"
375+
ls -l "$ZSIGN_PATH" || true
376376
377-
# Process each cert
378-
echo "$FULL_NAMES" | while IFS= read -r FULL_NAME; do
379-
if [ -z "$FULL_NAME" ]; then continue; fi
377+
# Process each cert
378+
echo "$FULL_NAMES" | while IFS= read -r FULL_NAME; do
379+
if [ -z "$FULL_NAME" ]; then continue; fi
380380
381-
# short name used for filenames: sanitize to lowercase alnum and dashes
382-
SHORT_NAME=$(echo "$FULL_NAME" | tr '[:upper:]' '[:lower:]' | sed -E 's/[^a-z0-9]+/-/g' | sed -E 's/^-+|-+$//g')
381+
# short name used for filenames: sanitize to lowercase alnum and dashes
382+
SHORT_NAME=$(echo "$FULL_NAME" | tr '[:upper:]' '[:lower:]' | sed -E 's/[^a-z0-9]+/-/g' | sed -E 's/^-+|-+$//g')
383383
384-
# URL-encode the full display name for the GitHub path
385-
ENCODED=$(python3 -c "import sys,urllib.parse as u; print(u.quote(sys.stdin.read().strip()))" <<< "$FULL_NAME")
384+
# URL-encode the full display name for the GitHub path
385+
ENCODED=$(python3 -c "import sys,urllib.parse as u; print(u.quote(sys.stdin.read().strip()))" <<< "$FULL_NAME")
386386
387-
CERT_DIR="certs/$SHORT_NAME"
388-
mkdir -p "$CERT_DIR"
389-
pushd "$CERT_DIR" >/dev/null
387+
CERT_DIR="certs/$SHORT_NAME"
388+
mkdir -p "$CERT_DIR"
389+
pushd "$CERT_DIR" >/dev/null
390390
391-
# download files; if any are missing this will fail, which is likely what you want
392-
curl -fLO "https://github.com/ProStore-iOS/certificates/raw/refs/heads/main/${ENCODED}/${ENCODED}.mobileprovision"
393-
curl -fLO "https://github.com/ProStore-iOS/certificates/raw/refs/heads/main/${ENCODED}/${ENCODED}.p12"
394-
curl -fLO "https://github.com/ProStore-iOS/certificates/raw/refs/heads/main/${ENCODED}/password.txt"
391+
# download files; if any are missing this will fail, which is likely what you want
392+
curl -fLO "https://github.com/ProStore-iOS/certificates/raw/refs/heads/main/${ENCODED}/${ENCODED}.mobileprovision"
393+
curl -fLO "https://github.com/ProStore-iOS/certificates/raw/refs/heads/main/${ENCODED}/${ENCODED}.p12"
394+
curl -fLO "https://github.com/ProStore-iOS/certificates/raw/refs/heads/main/${ENCODED}/password.txt"
395395
396-
popd >/dev/null
396+
popd >/dev/null
397397
398-
SIGNED_IPA="build/com.prostoreios.prostore-signed-${SHORT_NAME}-ios.ipa"
398+
SIGNED_IPA="build/com.prostoreios.prostore-signed-${SHORT_NAME}-ios.ipa"
399399
400-
# run zsign
401-
"$ZSIGN_PATH" -k "${CERT_DIR}/${ENCODED}.p12" \
402-
-p "$(cat "${CERT_DIR}/password.txt")" \
403-
-m "${CERT_DIR}/${ENCODED}.mobileprovision" \
404-
-o "$SIGNED_IPA" \
405-
"$UNSIGNED_IPA"
400+
# run zsign
401+
"$ZSIGN_PATH" -k "${CERT_DIR}/${ENCODED}.p12" \
402+
-p "$(cat "${CERT_DIR}/password.txt")" \
403+
-m "${CERT_DIR}/${ENCODED}.mobileprovision" \
404+
-o "$SIGNED_IPA" \
405+
"$UNSIGNED_IPA"
406406
407-
echo "Signed IPA created: $SIGNED_IPA"
408-
done
407+
echo "Signed IPA created: $SIGNED_IPA"
408+
done
409409
- name: Upload Artifacts
410410
if: always()
411411
continue-on-error: true

0 commit comments

Comments
 (0)