Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
59 changes: 0 additions & 59 deletions .github/workflows/ios_emerge_upload_adhoc.yml

This file was deleted.

101 changes: 0 additions & 101 deletions .github/workflows/ios_emerge_upload_main.yml

This file was deleted.

65 changes: 64 additions & 1 deletion .github/workflows/ios_emerge_upload_pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,17 @@ jobs:
- name: Select Xcode version
run: sudo xcode-select -s '/Applications/Xcode_26.0.1.app/Contents/Developer'

- name: Install iOS platform
run: |
for i in 1 2 3 4 5; do
echo "Attempt $i to download iOS platform..."
xcodebuild -downloadPlatform iOS && exit 0
echo "Attempt $i failed, waiting 45s before retry..."
sleep 45
done
echo "All attempts failed"
exit 1

- name: Set up Ruby env
uses: ruby/setup-ruby@v1
with:
Expand All @@ -37,7 +48,7 @@ jobs:
run: |
echo $CERTIFICATE_BASE64 | base64 --decode > signing-cert.p12

- name: Build & upload iOS size analysis binary to Emerge Tools
- name: Build iOS binary
run: bundle exec fastlane ios build_upload_emerge
env:
ASC_KEY_ID: ${{ secrets.ASC_KEY_ID }}
Expand All @@ -50,3 +61,55 @@ jobs:
SENTRY_SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_SENTRY_AUTH_TOKEN }}
CONFIGURATION: Release
EMERGE_BUILD_TYPE: pull-request

- name: Print build log on failure
if: failure()
run: |
echo "=== Full Gym Build Log ==="
cat ~/Library/Logs/gym/HackerNews-HackerNews.log || echo "Log file not found"

- name: Upload to Emerge Tools via REST API
env:
EMERGE_API_TOKEN: ${{ secrets.EMERGE_API_KEY }}
run: |
set -e

ZIP_PATH="./build/HackerNews.xcarchive.zip"

echo "Zipping xcarchive..."
cd build && zip -r -q HackerNews.xcarchive.zip HackerNews.xcarchive && cd ..

echo "Getting upload URL from Emerge..."
UPLOAD_RESPONSE=$(curl -s -X POST "https://api.emergetools.com/upload" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "X-API-Token: $EMERGE_API_TOKEN" \
-d '{
"filename": "HackerNews.xcarchive.zip",
"branch": "${{ github.head_ref }}",
"repoName": "${{ github.repository }}",
"sha": "${{ github.event.pull_request.head.sha }}",
"baseSha": "${{ github.event.pull_request.base.sha }}",
"prNumber": "${{ github.event.pull_request.number }}"
}')

echo "Upload response: $UPLOAD_RESPONSE"

UPLOAD_URL=$(echo "$UPLOAD_RESPONSE" | jq -r '.uploadURL')

if [ -z "$UPLOAD_URL" ] || [ "$UPLOAD_URL" = "null" ]; then
echo "Failed to get upload URL. Response: $UPLOAD_RESPONSE"
exit 1
fi

echo "Uploading to Emerge..."
UPLOAD_STATUS=$(curl -s -o /dev/null -w "%{http_code}" -X PUT "$UPLOAD_URL" \
-H "Content-Type: application/zip" \
-T "$ZIP_PATH")

if [ "$UPLOAD_STATUS" -ne 200 ]; then
echo "Upload failed with status: $UPLOAD_STATUS"
exit 1
fi

echo "Successfully uploaded to Emerge Tools!"
93 changes: 0 additions & 93 deletions .github/workflows/ios_emerge_upload_snapshots.yml

This file was deleted.

21 changes: 21 additions & 0 deletions ios/HackerNews/Assets.xcassets/hero.imageset/Contents.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"images" : [
{
"filename" : "hero.jpg",
"idiom" : "universal",
"scale" : "1x"
},
{
"idiom" : "universal",
"scale" : "2x"
},
{
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"images" : [
{
"filename" : "size_analysis.png",
"idiom" : "universal",
"scale" : "1x"
},
{
"idiom" : "universal",
"scale" : "2x"
},
{
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.