Skip to content

Commit d1a2dd9

Browse files
hodl
1 parent ca1c02b commit d1a2dd9

5 files changed

Lines changed: 57 additions & 258 deletions

File tree

.github/workflows/ios_emerge_upload_adhoc.yml

Lines changed: 0 additions & 59 deletions
This file was deleted.

.github/workflows/ios_emerge_upload_main.yml

Lines changed: 0 additions & 101 deletions
This file was deleted.

.github/workflows/ios_emerge_upload_pr.yml

Lines changed: 56 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,9 @@ jobs:
2222
- name: Select Xcode version
2323
run: sudo xcode-select -s '/Applications/Xcode_26.0.1.app/Contents/Developer'
2424

25+
- name: Install iOS platform
26+
run: xcodebuild -downloadPlatform iOS
27+
2528
- name: Set up Ruby env
2629
uses: ruby/setup-ruby@v1
2730
with:
@@ -37,7 +40,7 @@ jobs:
3740
run: |
3841
echo $CERTIFICATE_BASE64 | base64 --decode > signing-cert.p12
3942
40-
- name: Build & upload iOS size analysis binary to Emerge Tools
43+
- name: Build iOS binary
4144
run: bundle exec fastlane ios build_upload_emerge
4245
env:
4346
ASC_KEY_ID: ${{ secrets.ASC_KEY_ID }}
@@ -50,3 +53,55 @@ jobs:
5053
SENTRY_SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_SENTRY_AUTH_TOKEN }}
5154
CONFIGURATION: Release
5255
EMERGE_BUILD_TYPE: pull-request
56+
57+
- name: Print build log on failure
58+
if: failure()
59+
run: |
60+
echo "=== Full Gym Build Log ==="
61+
cat ~/Library/Logs/gym/HackerNews-HackerNews.log || echo "Log file not found"
62+
63+
- name: Upload to Emerge Tools via REST API
64+
env:
65+
EMERGE_API_TOKEN: ${{ secrets.EMERGE_API_KEY }}
66+
run: |
67+
set -e
68+
69+
ZIP_PATH="./build/HackerNews.xcarchive.zip"
70+
71+
echo "Zipping xcarchive..."
72+
cd build && zip -r -q HackerNews.xcarchive.zip HackerNews.xcarchive && cd ..
73+
74+
echo "Getting upload URL from Emerge..."
75+
UPLOAD_RESPONSE=$(curl -s -X POST "https://api.emergetools.com/upload" \
76+
-H "Accept: application/json" \
77+
-H "Content-Type: application/json" \
78+
-H "X-API-Token: $EMERGE_API_TOKEN" \
79+
-d '{
80+
"filename": "HackerNews.xcarchive.zip",
81+
"branch": "${{ github.head_ref }}",
82+
"repoName": "${{ github.repository }}",
83+
"sha": "${{ github.event.pull_request.head.sha }}",
84+
"baseSha": "${{ github.event.pull_request.base.sha }}",
85+
"prNumber": "${{ github.event.pull_request.number }}"
86+
}')
87+
88+
echo "Upload response: $UPLOAD_RESPONSE"
89+
90+
UPLOAD_URL=$(echo "$UPLOAD_RESPONSE" | jq -r '.uploadURL')
91+
92+
if [ -z "$UPLOAD_URL" ] || [ "$UPLOAD_URL" = "null" ]; then
93+
echo "Failed to get upload URL. Response: $UPLOAD_RESPONSE"
94+
exit 1
95+
fi
96+
97+
echo "Uploading to Emerge..."
98+
UPLOAD_STATUS=$(curl -s -o /dev/null -w "%{http_code}" -X PUT "$UPLOAD_URL" \
99+
-H "Content-Type: application/zip" \
100+
-T "$ZIP_PATH")
101+
102+
if [ "$UPLOAD_STATUS" -ne 200 ]; then
103+
echo "Upload failed with status: $UPLOAD_STATUS"
104+
exit 1
105+
fi
106+
107+
echo "Successfully uploaded to Emerge Tools!"

.github/workflows/ios_emerge_upload_snapshots.yml

Lines changed: 0 additions & 93 deletions
This file was deleted.

ios/fastlane/Fastfile

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -186,10 +186,7 @@ platform :ios do
186186
load_asc_api_key
187187
prepare_signing
188188
build_app_for_scheme
189-
emerge(
190-
tag: ENV['EMERGE_BUILD_TYPE'],
191-
app_id_suffix: ENV['APP_ID_SUFFIX']
192-
)
189+
# Emerge upload moved to GitHub Action step using REST API
193190
export_thinned_build
194191
sentry_upload_build(
195192
auth_token: ENV['SENTRY_SENTRY_AUTH_TOKEN'],

0 commit comments

Comments
 (0)