Skip to content

Commit c9b87ae

Browse files
evan-masseauclaude
andcommitted
ci(example): add iOS TestFlight publish job alongside Android
Restructures the example app publish workflow as a single workflow with two parallel jobs (deploy-android, deploy-ios) sharing triggers and shared composite actions. Both ship together on workflow_dispatch and on every SDK release. iOS job mirrors the iOS test app's TestFlight workflow (klaviyo-ios-test-app/.github/workflows/testflight.yml): - Ephemeral keychain with Apple Distribution cert - Per-target Manual signing via xcodeproj Ruby gem (Modern Xcode ignores CLI signing flags) - ExportOptions.plist with provisioning profile UUIDs patched in at build time via PlistBuddy - xcrun altool upload with retry-on-collision (handles manual TestFlight uploads racing past github.run_number) - agvtool sets the build number across all targets per run RN-specific additions on top: - Node + Yarn setup before pod install (Metro bundler runs during archive) - bundle exec pod install --repo-update (no stale CDN pinning) - Delete .xcode.env.local so Xcode build phase resolves node via $PATH - GoogleService-Info.plist injected from a base64 secret (versus Android's plain-text google-services.json) so Firebase push works in the build Shared between jobs via composite actions: - .github/actions/example-publish-prep — verifies KLAVIYO_EXAMPLE_API_KEY and writes example/.env - .github/actions/notify-slack-publish — single notification action with result + platform inputs, replacing four duplicated payload blocks example/ios/ExportOptions.plist is checked in with a GH_actions UUID placeholder; CI overwrites it with the real UUID per run. Part of MAGE-464 Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent 86adfd6 commit c9b87ae

4 files changed

Lines changed: 337 additions & 66 deletions

File tree

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
name: Prepare example app for publish
2+
description: Verifies the Klaviyo example API key secret is set and writes example/.env so react-native-dotenv can expose it as KLAVIYO_API_KEY at build time.
3+
inputs:
4+
api_key:
5+
description: Klaviyo public API key (typically passed from secrets.KLAVIYO_EXAMPLE_API_KEY)
6+
required: true
7+
8+
runs:
9+
using: composite
10+
steps:
11+
- name: Verify Klaviyo example API key is set
12+
shell: bash
13+
env:
14+
KLAVIYO_API_KEY: ${{ inputs.api_key }}
15+
run: |
16+
if [ -z "${KLAVIYO_API_KEY}" ]; then
17+
echo "::error::Klaviyo example API key is empty. The build would produce an app that crashes at launch — set the KLAVIYO_EXAMPLE_API_KEY repo secret."
18+
exit 1
19+
fi
20+
21+
- name: Write example/.env
22+
shell: bash
23+
env:
24+
KLAVIYO_API_KEY: ${{ inputs.api_key }}
25+
run: echo "KLAVIYO_API_KEY=${KLAVIYO_API_KEY}" > example/.env
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
name: Notify Slack of example app publish result
2+
description: Posts a Slack message summarizing a publish job (success or failure) for the React Native SDK example app.
3+
inputs:
4+
webhook:
5+
description: Slack incoming webhook URL
6+
required: true
7+
result:
8+
description: "'success' or 'failure' — drives icon and headline"
9+
required: true
10+
platform:
11+
description: "Human-readable platform label (e.g. 'Play Store', 'TestFlight')"
12+
required: true
13+
version_label:
14+
description: Version string to show in the message (e.g. release tag or 'X.Y.Z (build)')
15+
required: false
16+
default: manual
17+
18+
runs:
19+
using: composite
20+
steps:
21+
- uses: slackapi/slack-github-action@v2.1.1
22+
with:
23+
webhook: ${{ inputs.webhook }}
24+
webhook-type: incoming-webhook
25+
payload: |
26+
text: "${{ inputs.result == 'success' && '✅' || '🚨' }} RN SDK Example App: ${{ inputs.platform }} ${{ inputs.result == 'success' && 'publish succeeded' || 'publish failed' }}"
27+
blocks:
28+
- type: "header"
29+
text:
30+
type: "plain_text"
31+
text: "${{ inputs.result == 'success' && '✅' || '🚨' }} RN SDK Example App: ${{ inputs.platform }} ${{ inputs.result == 'success' && 'publish succeeded' || 'publish failed' }}"
32+
- type: "section"
33+
text:
34+
type: "mrkdwn"
35+
text: "*Repository:* ${{ github.repository }}\n*Workflow:* ${{ github.workflow }}\n*Version:* `${{ inputs.version_label }}`\n*Commit:* `${{ github.sha }}`\n*Author:* ${{ github.actor }}"
36+
- type: "section"
37+
text:
38+
type: "mrkdwn"
39+
text: "*Workflow Run:* <${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}|View Details>"

0 commit comments

Comments
 (0)