Ci cd setup

From rshankras/claude-code-apple-skills · View interactive version

Ci cd setup is an AI agent skill from the GitHub repository rshankras/claude-code-apple-skills. Generate CI/CD configuration for automated builds, tests, and distribution of iOS/macOS apps. Use when setting up GitHub Actions, Xcode Cloud, or fastlane for continuous integration, TestFlight, or App Store deployment.

How to use this skill

Skill file

CI/CD Setup Generator

Generate CI/CD configuration for automated builds, tests, and distribution of iOS/macOS apps.

When This Skill Activates

Pre-Generation Checks

Before generating, verify:

  1. Existing CI Configuration

```bash

# Check for existing CI files

ls -la .github/workflows/ 2>/dev/null

ls -la ci_scripts/ 2>/dev/null

ls -la fastlane/ 2>/dev/null

```

  1. Project Structure

```bash

# Find Xcode project/workspace

find . -name ".xcodeproj" -o -name ".xcworkspace" | head -5

```

  1. Package Manager

```bash

# Check for SPM vs CocoaPods

ls Package.swift 2>/dev/null

ls Podfile 2>/dev/null

```

Configuration Questions

1. CI/CD Platform

2. Distribution Method

3. Include fastlane?

4. Code Signing Approach

Generated Files

GitHub Actions

.github/workflows/
├── build-test.yml        # PR checks, unit tests
├── deploy-testflight.yml # TestFlight deployment
└── deploy-appstore.yml   # App Store submission

Xcode Cloud

ci_scripts/
├── ci_post_clone.sh      # Post-clone setup
└── ci_pre_xcodebuild.sh  # Pre-build configuration

fastlane

fastlane/
├── Fastfile              # Lane definitions
├── Appfile               # App configuration
└── Matchfile             # Code signing (if using match)

SwiftLint

.swiftlint.yml            # from templates/swiftlint/swiftlint.yml

Merging Skill Rule Fragments

Skills in this library may ship graduated enforcement as a

rules/swiftlint.yml fragment (opt_in_rules + custom_rules) — prose

rules turned into deterministic lint. When generating .swiftlint.yml:

  1. Start from templates/swiftlint/swiftlint.yml.
  2. For each skill the project actually uses, check for

skills/<category>/<skill>/rules/swiftlint.yml; append its

custom_rules entries and union its opt_in_rules.

  1. Respect fragment scoping comments — e.g. observable_object_legacy

applies only to iOS 17+/macOS 14+ deployment targets, and

xctest_in_unit_tests must keep its UITests exclusion (XCUITest

legitimately requires XCTest).

  1. The generated build-test.yml runs the lint job automatically once

.swiftlint.yml exists (if: hashFiles('.swiftlint.yml') != '').

Current fragments: security/ (hardcoded secrets), ios/coding-best-practices

(print-in-production, legacy ObservableObject, force_unwrapping/force_try),

testing/tdd-feature (XCTest scoped out of unit tests),

swift/concurrency (@unchecked Sendable without justification).

Integration Steps

GitHub Actions Setup

  1. Add Repository Secrets (Settings > Secrets and variables > Actions):
  1. Create App Store Connect API Key:
  1. Export Certificate:

```bash

# Export from Keychain as .p12, then base64 encode

base64 -i certificate.p12 | pbcopy

```

Xcode Cloud Setup

  1. Enable Xcode Cloud in Xcode:
  1. Configure Workflow:
  1. Add ci_scripts to repository for customization

fastlane Setup

  1. Install fastlane:

```bash

brew install fastlane

```

  1. Initialize (if starting fresh):

```bash

fastlane init

```

  1. Set up match (optional, for code signing):

```bash

fastlane match init

fastlane match development

fastlane match appstore

```

Best Practices

Caching

Secrets Management

Build Optimization

Notifications

References

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.