Setup Swift GitHub Workflows
| This documentation was generated with the assistance of AI. Please report any inaccuracies. |
Scaffold (or update) the build.yml, release.yml, sync.yml (gitflow only), security.yml, and
.github/dependabot.yml GitHub Actions workflows for a Swift repository produced by iru-setup-swift-library
(a SwiftPM package) or iru-setup-apple-app (an XcodeGen/Tuist-generated Xcode app).
Purpose
iru-setup-swift-github-workflows wires up the house CI/CD pipeline for the Swift/Apple stack: SwiftLint
swift format lint --strict, a build/test step whose shape depends on flavor (library:
swift test --enable-code-coverage --parallel with a .build cache keyed on Package.resolved, plus an
xcrun llvm-cov-to-SonarQube-generic-XML coverage conversion and an optional ubuntu-latest Linux matrix leg; app,
following iru-setup-apple-app’s scaffold contract: a Linux `lint job (SwiftLint release binary + swift format
in a swift container), a macOS core job (Packages/Core swift test --enable-code-coverage + llvm-cov with an
80% line bar, plus DocC), and an apps matrix with one leg per platform scheme (<AppName>-iOS/-watchOS/
-visionOS/-macOS) that runs xcodegen generate/tuist generate, xcodebuild build-for-testing against
generic/platform=<P> Simulator, then test-without-building on the newest simulator runtime resolved from
xcrun simctl — visionOS tests reported unverified when the runner image has no visionOS runtime — and uploads
each .xcresult), an optional SonarQube/SonarCloud scan (Linux for the app flavor, fed Core’s lcov), a DocC + Antora documentation build published to GitHub Pages from the stable
branch (or, with pages: no, built and uploaded as a docs-site workflow artifact without publishing), a release workflow (library: verifies the release tag is valid semver and the manifest still parses,
plus an optional release-please job; app: plain xcodebuild archive + -exportArchive with destination: upload
to App Store Connect via the API key for iOS (watch app embedded), visionOS and a standalone watchOS app, and
Developer ID export + notarization + stapling for macOS — the Fastfile’s match + beta/release lane drives
the iOS upload only when fastlane/ exists and signing: fastlane-match, so no job requires Fastlane), a gitflow-only sync.yml that merges a
released branch back into the integration branch and bumps the development version (reusing
iru-swift-bump-version’s exact rewrite targets via a vendored `sync_versions.py), and a
security.yml/dependabot.yml block (dependency-review, CodeQL, OSV-Scanner, gitleaks). Unlike its
Java/TypeScript/Android siblings, no single real Swift repository exists to genericize these templates from —
they are assembled instead from this catalog’s own already-verified iru-setup-swift-library/
iru-setup-apple-app/iru-swift-coverage/iru-swift-bump-version commands, plus this skill’s own verification
pass. It announces whether it is creating the pipeline from scratch or updating an existing one. It creates every
workflow that doesn’t exist, and for each one that already exists it warns and asks Update (merge using the
templates as reference, keeping foreign steps and jobs) / Keep as is (listing every mismatch with this run’s
choices) / Replace (regenerate; customizations lost) / Stop, or applies on-existing from args. Because nearly
every job runs on macOS runners (about 10x the cost of Linux minutes, billed against included minutes on private
repositories), it resolves visibility and asks sonar, ci-tests and pages with those cost facts; ci-tests:
unit skips the app’s XCUITest bundles (-skip-testing:<AppName>UITests-<Platform>, or a library integration-test
target) in CI. For the app flavor it recommends runner: xcode-27 + xcode-version: 27.1 (the Xcode the scaffold
was verified with), since only that preview image offers it. Neither macos-26 (arm64) nor xcode-27 ships
SwiftLint preinstalled (only macos-26-intel does), so the library flavor keeps a brew install swiftlint guard and
the app flavor lints on Linux. Every generator-dependent step — the apps legs in build.yml, and in release.yml
the version check (project.yml vs Project.swift MARKETING_VERSION) and each archive job’s project generation —
is written for exactly the detected generator (xcodegen generate or tuist generate --no-open).
Plugin
Shipped by the iru-swift plugin of the ai-catalog marketplace (install with /plugin install iru-swift@ai-catalog; see Plugins).
Inputs
| Argument | Required | Description | Default |
|---|---|---|---|
|
No |
Pre-resolved values, one per line, for |
None — if |
Outputs
-
UI-contract capture upload (see Building user interfaces), inside the existing test legs with no extra job or minutes: a package with SwiftUI/UIKit/AppKit views uploads
.ui-screenshots/as a 7-dayui-screenshotsartifact; each app leg passesTEST_RUNNER_UI_SCREENSHOTS_DIR, copies the captures attached to the.xcresultinto.ui-screenshots/withxcrun xcresulttool export attachments, and uploads them asui-screenshots-<scheme>(if-no-files-found: ignore). When.ui-quality.ymlsetsaccessibility: none, no accessibility report (a11y-report.txt), upload or accessibility-only step is emitted; the UI test run and screenshot upload are unaffected. -
.github/workflows/build.yml,release.yml(app flavor: only whendistributionisn’tnone), and (gitflow only)sync.yml— created fresh, or updated, replaced or kept as is per file when it already existed (the user’s Update / Keep as is / Replace choice, oron-existing).build.ymlhonoursci-tests(UI-test bundles or integration targets skipped whenunit) andpages(adocs-siteartifact upload instead of the Pages deploy job whenno). -
.github/workflows/security.ymland.github/dependabot.yml— always written (or updated), independent offlavor/branching. -
.github/scripts/sync_versions.py, always written together withsync.yml— never one without the other, and never formain-only. -
.github/scripts/lcov_to_sonar_generic.py— wheneversonarisn’tnone, for both flavors (the app flavor convertsPackages/Core’s lcov, not an `.xcresult). -
A report of the mode announced (from scratch or update), the action taken per file (created / updated / replaced / kept as is, with each mismatch listed for a kept file), how
visibility,ci-testsandpageswere applied, whichappsmatrix legs and release jobs (app-store,fastlane-ios,macos-developer-id) were written and whether the visionOS leg runs its tests on the chosen runner, open gaps (missingdocs/antora.yml, aPackages/Corewith noswift-docc-plugindependency, anAPPLE_TEAM_IDsecret the user still needs to add, version wording that didn’t matchsync_versions.py’s regexes), the required-secrets table below, and warnings about what could not be exercised locally (the Linux `lintcontainer, signed archives, uploads, notarization, the Fastlane lane, visionOS test runs).
File matrix
flavor × branching |
Files written |
|---|---|
|
|
|
Same, minus |
|
|
|
Same, minus |
Required secrets
| Secret | Purpose | Only needed when |
|---|---|---|
|
Auth token for the SonarQube/SonarCloud scan |
|
|
`fastlane match’s certs-repo URL and its encryption passphrase |
|
|
base64 of |
|
|
App Store Connect API key — |
|
|
Apple Developer Team ID — |
|
|
Exported Developer ID Application certificate for the macOS |
|
|
|
Automatic — no setup needed |
sync.yml also needs the repository setting under Settings → Actions → General → "Workflow permissions" set
to allow GitHub Actions to create pull requests. The Pages deploy job needs Settings → Pages → "Build and
deployment" → Source set to GitHub Actions — only when pages: yes; on a private or internal repository that
also needs a GitHub Pro, Team or Enterprise Cloud plan, and the published site is public unless Enterprise Cloud
private access control is used.
The generated files' bytes come from template files under templates/ (and, where a template needs variant-specific notes, reference/) in .claude/skills/iru-setup-swift-github-workflows/; the skill reads only the files for the variant it resolved, not the whole set, which keeps its SKILL.md small.
Execution flow
Dependencies
Invokes
None — iru-setup-swift-github-workflows is a leaf skill; it does not call any other skill in this catalog.
Invoked by
-
Setup Swift Repository — Step 8 runs
iru-setup-swift-github-workflows(via theiru-isolated-skill-executoragent), passing the pipeline parameters it already resolved throughargsaskey: valuelines so it isn’t asked — or made to re-survey the repository — for facts the orchestrator already has.
Related agents
iru-gate-runner — Step 13’s verification pass (YAML validation and, for the
app flavor, actionlint + shellcheck of every rendered file, resolving every uses: ref, and real shell-step
runs against copied iru-setup-swift-library/iru-setup-apple-app scaffolds) runs through this agent where output
could be long.
Source
SKILL.md on GitHub — the file this page was generated from.