Skip to content

Commit 510003e

Browse files
authored
Merge pull request #6 from softwareone-platform/infra/mpt-14510-add-pr-builds
feat: Add CI/CD workflows for PR builds, main branch, and TestFlight deployment
2 parents 2359ef0 + 560dd78 commit 510003e

File tree

18 files changed

+2591
-127
lines changed

18 files changed

+2591
-127
lines changed

.github/TESTFLIGHT_SETUP.md

Lines changed: 188 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,188 @@
1+
# TestFlight Deployment Setup Checklist
2+
3+
This document provides step-by-step instructions to complete the TestFlight deployment setup.
4+
5+
## Two Workflows: Build vs Deploy
6+
7+
This project separates iOS building from TestFlight deployment:
8+
9+
### iOS Build Workflow (`.github/workflows/ios-build.yml`)
10+
- **Purpose:** Build verification only, NO deployment
11+
- **Use for:** Testing builds, verifying code compiles, creating test artifacts
12+
- **No secrets required**
13+
- **Faster:** ~20-30 minutes
14+
- **Output:** Unsigned .app file (7-day retention)
15+
16+
### iOS TestFlight Workflow (`.github/workflows/ios-testflight.yml`)
17+
- **Purpose:** Complete deployment to TestFlight
18+
- **Use for:** Deploying to testers, release candidates
19+
- **Requires:** TestFlight environment secrets (see below)
20+
- **Longer:** ~30-45 minutes
21+
- **Output:** Signed IPA + dSYMs (30-day retention) + TestFlight build
22+
23+
## ✅ Completed
24+
25+
- [x] Created `TestFlight` GitHub environment
26+
- [x] Created iOS Build workflow for verification (`.github/workflows/ios-build.yml`)
27+
- [x] Created iOS TestFlight deployment workflow (`.github/workflows/ios-testflight.yml`)
28+
- [x] Configured npm and CocoaPods caching
29+
- [x] Documented all required secrets
30+
- [x] Updated README.md and CLAUDE.md with deployment instructions
31+
- [x] Separated build verification from deployment for cost optimization
32+
33+
## 📋 Required Actions
34+
35+
### 1. Configure Secrets in TestFlight Environment
36+
37+
All secrets must be added to the `TestFlight` GitHub environment (not repository secrets).
38+
39+
**How to add secrets:**
40+
1. Go to: https://github.com/softwareone-platform/mpt-mobile-platform/settings/environments
41+
2. Click on **TestFlight** environment
42+
3. Scroll to **Environment secrets**
43+
4. Click **Add secret** for each secret below
44+
45+
**Important Note on Secrets:**
46+
- GitHub secrets are read-only and cannot be copied between repositories
47+
- All secrets must be recreated in the new TestFlight environment
48+
- The original secret values are available locally (contact team for access)
49+
- Reference PoC repository for secret names: https://github.com/softwareone-platform/mpt-mobile-reactnative-poc/settings/secrets/actions
50+
51+
**Required Secrets List:**
52+
53+
#### App Store Connect API (3 secrets)
54+
```
55+
APP_STORE_CONNECT_API_KEY_ID
56+
APP_STORE_CONNECT_ISSUER_ID
57+
APP_STORE_CONNECT_API_KEY_CONTENT
58+
```
59+
60+
#### iOS Code Signing (4 secrets)
61+
```
62+
IOS_DISTRIBUTION_CERTIFICATE_P12_BASE64
63+
IOS_DISTRIBUTION_CERTIFICATE_PASSWORD
64+
IOS_PROVISIONING_PROFILE_BASE64
65+
PROVISIONING_PROFILE_SPECIFIER
66+
```
67+
68+
#### Auth0 - Test Environment (4 secrets)
69+
```
70+
AUTH0_DOMAIN_TEST
71+
AUTH0_CLIENT_ID_TEST
72+
AUTH0_AUDIENCE_TEST
73+
AUTH0_API_URL_TEST
74+
```
75+
76+
#### Auth0 - Production Environment (4 secrets - Optional)
77+
```
78+
AUTH0_DOMAIN_PROD
79+
AUTH0_CLIENT_ID_PROD
80+
AUTH0_AUDIENCE_PROD
81+
AUTH0_API_URL_PROD
82+
```
83+
84+
**Total: 15 secrets required**
85+
86+
### 2. (Optional) Configure Environment Protection Rules
87+
88+
To require manual approval before deployment:
89+
90+
1. Go to: https://github.com/softwareone-platform/mpt-mobile-platform/settings/environments
91+
2. Click on **TestFlight** environment
92+
3. Under **Deployment protection rules**:
93+
- Check **Required reviewers**
94+
- Add users who should approve deployments (CODEOWNERS)
95+
- Recommended: Add at least one senior developer or team lead
96+
4. Under **Deployment branches**:
97+
- Select **Protected branches only** to only allow deployments from `main`
98+
5. Click **Save protection rules**
99+
100+
### 3. Verify Workflow Configuration
101+
102+
Before first deployment, verify these values in `.github/workflows/ios-testflight.yml`:
103+
104+
```yaml
105+
env:
106+
NODE_VERSION: '20' # ✅ Correct
107+
XCODE_VERSION: '16.0' # ✅ Update if needed
108+
APP_BUNDLE_ID: 'com.softwareone.marketplaceMobile' # ✅ Correct
109+
DEVELOPMENT_TEAM: '47PY6J2KQC' # ✅ Correct
110+
APP_STORE_APP_ID: '6752612555' # ✅ Correct (same as Flutter app)
111+
```
112+
113+
### 4. Test the Workflow
114+
115+
Once secrets are configured:
116+
117+
1. Go to **Actions** tab
118+
2. Select **iOS TestFlight Deployment**
119+
3. Click **Run workflow**
120+
4. Configure:
121+
- Version bump: `build` (safest for first test)
122+
- Environment: `test`
123+
5. Click **Run workflow**
124+
6. Monitor the workflow execution (~30-45 minutes)
125+
7. Check for any errors in the logs
126+
8. Verify the build appears in App Store Connect → TestFlight after 10-15 minutes
127+
128+
### 5. Common Issues and Solutions
129+
130+
**Issue: "Failed to create API key file"**
131+
- Solution: Verify `APP_STORE_CONNECT_API_KEY_CONTENT` is correctly base64-encoded
132+
133+
**Issue: "Certificate import failed"**
134+
- Solution: Verify `IOS_DISTRIBUTION_CERTIFICATE_P12_BASE64` is correctly base64-encoded
135+
- Verify `IOS_DISTRIBUTION_CERTIFICATE_PASSWORD` is correct
136+
137+
**Issue: "Provisioning profile not found"**
138+
- Solution: Verify `PROVISIONING_PROFILE_SPECIFIER` exactly matches the profile name
139+
- Verify `IOS_PROVISIONING_PROFILE_BASE64` is correctly base64-encoded
140+
141+
**Issue: "Upload to TestFlight failed"**
142+
- Solution: Check App Store Connect API key permissions (should be Admin or Developer)
143+
- Verify `APP_STORE_CONNECT_ISSUER_ID` is correct
144+
145+
## 📱 After First Successful Deployment
146+
147+
1. **Verify in App Store Connect:**
148+
- Go to: https://appstoreconnect.apple.com/apps/6752612555/testflight/ios
149+
- Confirm the build appears
150+
- Check for any processing errors
151+
152+
2. **Add Internal Testers:**
153+
- Go to TestFlight → Internal Testing
154+
- Add testers from your organization
155+
- Provide release notes
156+
157+
3. **Test the App:**
158+
- Download TestFlight app on iOS device
159+
- Install and test the build
160+
- Report any issues
161+
162+
4. **Monitor Future Deployments:**
163+
- Each deployment creates a git tag (e.g., `v4.0.0-build123`)
164+
- Build number auto-increments in `app.json`
165+
- IPA and dSYMs available as artifacts for 30 days
166+
167+
## 🔗 Useful Links
168+
169+
- **TestFlight Environment:** https://github.com/softwareone-platform/mpt-mobile-platform/settings/environments
170+
- **Actions Tab:** https://github.com/softwareone-platform/mpt-mobile-platform/actions
171+
- **App Store Connect:** https://appstoreconnect.apple.com/apps/6752612555
172+
- **PoC Secrets (for copying):** https://github.com/softwareone-platform/mpt-mobile-reactnative-poc/settings/secrets/actions
173+
174+
## 📚 Documentation
175+
176+
- Full deployment process: [README.md](../README.md#testflight-deployment)
177+
- Detailed secrets documentation: [CLAUDE.md](../CLAUDE.md#testflight-deployment)
178+
- Workflow file: [ios-testflight.yml](workflows/ios-testflight.yml)
179+
180+
## ✨ Next Steps After Setup
181+
182+
Once TestFlight deployment is working:
183+
184+
1. Consider setting up external testing groups
185+
2. Implement automated release notes from git commits
186+
3. Consider notification integration (Slack, Teams) for successful deployments
187+
4. Document internal testing procedures
188+
5. Plan production App Store submission workflow (separate from TestFlight)

0 commit comments

Comments
 (0)