# Publish iOS with Codemagic (no Mac)

## Prerequisites

- [Codemagic](https://codemagic.io) account
- Git repository connected to Codemagic
- Apple Developer account + app in App Store Connect

## 1. Add CI to the project (if missing)

```bash
kasy add ci
```

Creates `codemagic.yaml` at the project root.

## 2. Configure in the Codemagic dashboard

1. Open [codemagic.io/apps](https://codemagic.io/apps) and add your repository.
2. **Code signing (iOS):** set up App Store distribution certificate and profile.
3. **Integrations → App Store Connect:** link your Apple account.
4. **Environment variables:** add to your variable group (e.g. `appstore_credentials`):
   - `BACKEND_URL`, `SENTRY_DSN`, `RC_IOS_API_KEY`, `RC_ANDROID_API_KEY`, `MIXPANEL_TOKEN`
5. In `codemagic.yaml`, set `APP_ID` (numeric App Store Connect app ID from the app URL).

## 3. Configure from the terminal

```bash
kasy codemagic configure
```

Enter **API token** (Settings → Codemagic API), **App ID**, and **Workflow ID** (default `ios-workflow`).

## 4. Trigger a build

```bash
kasy codemagic release
```

The cloud build runs and may upload to TestFlight per `codemagic.yaml`.

## Build status

```bash
kasy codemagic status <buildId>
```

## Local Mac

If you have a Mac: [ios-release.md](./ios-release.md) and `kasy ios release`.
