iOS Build using GH Actions
Build & Push Docker Images / test-backend (push) Successful in 21s
Build & Push Docker Images / test-frontend (push) Successful in 22s
Build & Push Docker Images / build-backend (push) Successful in 16s
Build & Push Docker Images / build-frontend (push) Successful in 17s
Build & Push Docker Images / test-backend (push) Successful in 21s
Build & Push Docker Images / test-frontend (push) Successful in 22s
Build & Push Docker Images / build-backend (push) Successful in 16s
Build & Push Docker Images / build-frontend (push) Successful in 17s
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
# Native Mobile App Build Guide
|
||||
|
||||
FarmaFinder ships as a PWA and is wrapped for the App Store / Play Store via [Capacitor 6](https://capacitorjs.com). The web frontend in `frontend/` is bundled into each native shell — there's no separate codebase for Android or iOS.
|
||||
FarmaFinder ships as a PWA and is wrapped for the App Store / Play Store via [Capacitor 8](https://capacitorjs.com). The web frontend in `frontend/` is bundled into each native shell — there's no separate codebase for Android or iOS.
|
||||
|
||||
```
|
||||
FarmaFinder/
|
||||
@@ -176,6 +176,103 @@ Both stores require: privacy policy URL, screenshots (multiple device sizes), an
|
||||
|
||||
---
|
||||
|
||||
## CI/CD: GitHub Actions (iOS)
|
||||
|
||||
The project includes a GitHub Actions workflow for automated iOS builds, replacing the previous Bitrise pipeline.
|
||||
|
||||
### Workflow file
|
||||
|
||||
`.github/workflows/ios-build.yml` — builds the iOS app on every `ios-v*` tag push, or manually via `workflow_dispatch`.
|
||||
|
||||
### Trigger types
|
||||
|
||||
| Trigger | Behaviour |
|
||||
|---------|-----------|
|
||||
| `git push ios-v*` tag | Builds, archives, exports IPA, uploads to TestFlight |
|
||||
| `workflow_dispatch` (manual) | Builds and optionally uploads to TestFlight (configurable) |
|
||||
|
||||
### Required GitHub Secrets
|
||||
|
||||
Set these in **Settings → Secrets and variables → Actions**:
|
||||
|
||||
| Secret | Description |
|
||||
|--------|-------------|
|
||||
| `IOS_P12_BASE64` | Base64-encoded `.p12` distribution certificate |
|
||||
| `IOS_P12_PASSWORD` | Password for the `.p12` file |
|
||||
| `IOS_PROVISION_PROFILE_BASE64` | Base64-encoded `.mobileprovision` file |
|
||||
| `IOS_PROVISION_PROFILE_UUID` | UUID of the provisioning profile (filename in `~/Library/MobileDevice/Provisioning Profiles/`) |
|
||||
| `IOS_PROVISION_PROFILE_NAME` | Name of the provisioning profile (used in Xcode export) |
|
||||
| `IOS_TEAM_ID` | Apple Developer Team ID (10-char alphanumeric) |
|
||||
| `APP_STORE_API_KEY_ID` | App Store Connect API key ID |
|
||||
| `APP_STORE_API_ISSUER_ID` | App Store Connect API issuer ID |
|
||||
| `APP_STORE_API_PRIVATE_KEY` | App Store Connect API private key (`.p8` content) |
|
||||
|
||||
### Pipeline steps
|
||||
|
||||
1. **Test** (ubuntu-latest) — runs backend + frontend test suites
|
||||
2. **Build iOS** (macos-14 — Apple Silicon runner):
|
||||
- Installs Node 20, builds web bundle, syncs Capacitor
|
||||
- Installs CocoaPods dependencies
|
||||
- Imports signing certificate + provisioning profile from secrets
|
||||
- Sets `MARKETING_VERSION` / `CURRENT_PROJECT_VERSION` from tag
|
||||
- Builds `.xcarchive`, exports `.ipa`
|
||||
- Uploads IPA as GitHub artifact (30-day retention)
|
||||
- Uploads to TestFlight via `xcrun altool`
|
||||
|
||||
### Local iOS build script
|
||||
|
||||
For local builds on macOS, use the provided script:
|
||||
|
||||
```bash
|
||||
./scripts/build-ios.sh
|
||||
```
|
||||
|
||||
This performs the same steps (build web, sync, pod install, archive, export IPA) without the CI signing/TestFlight steps. Override the export-options path with:
|
||||
|
||||
```bash
|
||||
EXPORT_OPTIONS=path/to/export-options.plist ./scripts/build-ios.sh
|
||||
```
|
||||
|
||||
### Export Options
|
||||
|
||||
`scripts/export-options.plist` configures the IPA export (App Store method, manual signing, team ID, provisioning profile). The workflow replaces placeholder values from secrets at build time.
|
||||
|
||||
### Release flow
|
||||
|
||||
```bash
|
||||
# 1. Tag a release
|
||||
git tag ios-v1.2.3
|
||||
git push origin ios-v1.2.3
|
||||
|
||||
# 2. GitHub Actions runs automatically:
|
||||
# test → build → archive → IPA artifact → TestFlight upload
|
||||
|
||||
# 3. Download the IPA from the Actions Artifacts section if needed
|
||||
|
||||
# 4. Submit via App Store Connect after TestFlight review
|
||||
```
|
||||
|
||||
### Migrating from Bitrise
|
||||
|
||||
The `bitrise.yml` is still present but no longer needed for iOS. To remove it:
|
||||
|
||||
```bash
|
||||
rm bitrise.yml
|
||||
```
|
||||
|
||||
Key differences from the Bitrise pipeline:
|
||||
|
||||
| Aspect | Bitrise | GitHub Actions |
|
||||
|--------|---------|----------------|
|
||||
| Runner | Bitrise macOS stack | `macos-14` (M1 Apple Silicon) |
|
||||
| Signing | Bitrise certificate step | `apple-actions/import-codesign-certs` |
|
||||
| TestFlight upload | `deploy-to-bitrise-io` | `xcrun altool` with App Store Connect API |
|
||||
| Trigger | Tag `ios-v*` | Tag `ios-v*` or manual dispatch |
|
||||
| Artifact | Bitrise dashboard | GitHub Actions Artifacts (30-day retention) |
|
||||
| Cache | Bitrise stack caching | `actions/setup-node` cache |
|
||||
|
||||
---
|
||||
|
||||
## Updating Capacitor / plugins
|
||||
|
||||
```bash
|
||||
|
||||
Reference in New Issue
Block a user