Open source Grok Bot alternative, Bring your own agent and subscription: message Claude Code, Codex, Gemini CLI, Cursor, Copilot and 40+ AI agents as bots on your own computer, from iPhone, Mac, Windows, Linux or terminal. Agent-agnostic and free. Also a Muse and Dots alternative. Built in Rust.
Rust acpagent-client-protocolai-agentsai-assistantclaudeclaude-codecodexcoding-agentscursorgeminigemini-cligrok-bot-alternativeiosiphonelinuxmacosmcpopen-sourcerustself-hosted
fix(ci): ship the iPhone build even when Xcode Cloud misses the release tag
leepokaid78fa37312af
diff --git a/.github/workflows/ios-submit.yml b/.github/workflows/ios-submit.ymlindex 7feda3e1..68db3c4f 100644--- a/.github/workflows/ios-submit.yml+++ b/.github/workflows/ios-submit.yml@@ -1,6 +1,7 @@name: Submit iOS-# On each v* tag that changes the iPhone app, starts the Xcode Cloud archive on that tag,+# On each v* tag that changes the iPhone app, starts the Xcode Cloud archive on that tag+# (or on main while main is the tagged commit, when Xcode Cloud never heard of the tag),# waits for the upload and submits it for App Review. Host/macOS-only releases skip iOS.on:push:diff --git a/docs/guides/development.md b/docs/guides/development.mdindex cfaf002d..920c387c 100644--- a/docs/guides/development.md+++ b/docs/guides/development.md@@ -126,4 +126,4 @@ To bump, set `version` in `host/crates/memory/Cargo.toml` (patch for fixes, mino## iOS releases (Xcode Cloud)-The Xcode Cloud workflow "Release" on the product "iOS" has no automatic start condition (its own tag trigger never fired); it only runs when started through the API, and it archives the `iOS` scheme in Release with deployment preparation **TestFlight and App Store** (the "Internal Testing Only" option produces builds App Review can't take) and uploads it to App Store Connect. Xcode Cloud overrides the build number with its own counter (`CI_BUILD_NUMBER`, configured under Xcode Cloud settings → Build Number in App Store Connect), so `CURRENT_PROJECT_VERSION` in `project.yml` is only the local default. The checked-in `apps/Codync.xcodeproj` is what the cloud builds: regenerate it whenever `project.yml` changes, and commit `apps/Codync.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved` whenever a package version changes (Xcode Cloud never resolves packages itself; copy `apps/ios/Kit/Package.resolved` there if Xcode wrote it to `apps/ios/Kit/`). Xcode Cloud reads public package repositories without any connection. The `Submit iOS` GitHub workflow (`.github/workflows/ios-submit.yml` → `tools/asc-submit.py`, secrets `ASC_KEY_ID`, `ASC_ISSUER_ID`, `ASC_PRIVATE_KEY`) runs on every `v*` tag (the tags Auto Tag pushes after a version bump on `main`). It compares the tag with the last version sent to App Review (a version never sent or pulled back, such as one a failed run left behind, doesn't count; a rejected one does): when nothing the iPhone app is built from changed (`apps/ios/` including `apps/ios/Kit/`, except `WhatsNew.md` and the Kit tests, `apps/shared/`, the package pins, or `apps/project.yml` beyond its version lines), iOS skips that release, so host- or desktop-only releases neither build nor touch a version in review. Otherwise it starts the Xcode Cloud archive on the tag, waits for that build to finish processing and submits it for App Review, released automatically after approval. The latest version wins: a version still *Waiting for Review* is pulled back, renamed and resubmitted with the new build; one already *In Review* or approved is left alone (rerun the workflow with the version once it is out). *What's New* comes from the version's `## <version>` section in `apps/ios/WhatsNew.md` (one `### <locale>` per App Store language, written in the version bump); without one, the `### zh-Hant` / `### en-US` bullets under `## What's New` in the PR template are collected from every PR merged since the last App Store version (changes pushed to `main` without a PR add nothing); with neither, empty fields get a generic "Bug fixes and improvements" line. Running `Submit iOS` by hand with a version ships it even without iPhone changes. After each `Submit iOS` run, the `iOS dSYMs` workflow (`.github/workflows/ios-dsyms.yml` → `tools/upload-dsyms.py`, on macOS) downloads that release's archive from Xcode Cloud and uploads its dSYMs to PostHog (secret `POSTHOG_CLI_API_KEY`), so iPhone crash reports are symbolicated; run it by hand with a version after a manual `Submit iOS` or to upload an older one ([iPhone crash tracing](iphone-crash-tracing.md)). `python3 tools/asc-submit-test.py` checks the PR parsing and the change detection. `DRY_RUN=1 tools/asc-submit.py <version>` prints the writes without making them.+The Xcode Cloud workflow "Release" on the product "iOS" has no automatic start condition (its own tag trigger never fired); it only runs when started through the API, and it archives the `iOS` scheme in Release with deployment preparation **TestFlight and App Store** (the "Internal Testing Only" option produces builds App Review can't take) and uploads it to App Store Connect. Xcode Cloud overrides the build number with its own counter (`CI_BUILD_NUMBER`, configured under Xcode Cloud settings → Build Number in App Store Connect), so `CURRENT_PROJECT_VERSION` in `project.yml` is only the local default. The checked-in `apps/Codync.xcodeproj` is what the cloud builds: regenerate it whenever `project.yml` changes, and commit `apps/Codync.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved` whenever a package version changes (Xcode Cloud never resolves packages itself; copy `apps/ios/Kit/Package.resolved` there if Xcode wrote it to `apps/ios/Kit/`). Xcode Cloud reads public package repositories without any connection. The `Submit iOS` GitHub workflow (`.github/workflows/ios-submit.yml` → `tools/asc-submit.py`, secrets `ASC_KEY_ID`, `ASC_ISSUER_ID`, `ASC_PRIVATE_KEY`) runs on every `v*` tag (the tags Auto Tag pushes after a version bump on `main`). It compares the tag with the last version sent to App Review (a version never sent or pulled back, such as one a failed run left behind, doesn't count; a rejected one does): when nothing the iPhone app is built from changed (`apps/ios/` including `apps/ios/Kit/`, except `WhatsNew.md` and the Kit tests, `apps/shared/`, the package pins, or `apps/project.yml` beyond its version lines), iOS skips that release, so host- or desktop-only releases neither build nor touch a version in review. Otherwise it starts the Xcode Cloud archive on the tag (or on `main` while `main` is the tagged commit: Xcode Cloud hears of a new tag through a GitHub webhook that sometimes never arrives), waits for that build to finish processing and submits it for App Review, released automatically after approval. The latest version wins: a version still *Waiting for Review* is pulled back, renamed and resubmitted with the new build; one already *In Review* or approved is left alone (rerun the workflow with the version once it is out). *What's New* comes from the version's `## <version>` section in `apps/ios/WhatsNew.md` (one `### <locale>` per App Store language, written in the version bump); without one, the `### zh-Hant` / `### en-US` bullets under `## What's New` in the PR template are collected from every PR merged since the last App Store version (changes pushed to `main` without a PR add nothing); with neither, empty fields get a generic "Bug fixes and improvements" line. Running `Submit iOS` by hand with a version ships it even without iPhone changes. After each `Submit iOS` run, the `iOS dSYMs` workflow (`.github/workflows/ios-dsyms.yml` → `tools/upload-dsyms.py`, on macOS) downloads that release's archive from Xcode Cloud and uploads its dSYMs to PostHog (secret `POSTHOG_CLI_API_KEY`), so iPhone crash reports are symbolicated; run it by hand with a version after a manual `Submit iOS` or to upload an older one ([iPhone crash tracing](iphone-crash-tracing.md)). `python3 tools/asc-submit-test.py` checks the PR parsing, the change detection and the archive source. `DRY_RUN=1 tools/asc-submit.py <version>` prints the writes without making them.diff --git a/tools/asc-submit-test.py b/tools/asc-submit-test.pyindex 54955fe1..626896de 100644--- a/tools/asc-submit-test.py+++ b/tools/asc-submit-test.py@@ -1,4 +1,4 @@-"""Self-check for asc-submit.py's What's New parsing: python3 tools/asc-submit-test.py"""+"""Self-check for asc-submit.py: python3 tools/asc-submit-test.py"""import importlib.utilimport pathlib@@ -55,3 +55,18 @@ assert asc.last_sent(store(("2.19.3", "WAITING_FOR_REVIEW"), ("2.19.2", "READY_Fassert asc.last_sent(store(("2.20.0", "REJECTED"), ("2.19.2", "READY_FOR_DISTRIBUTION")), "2.20.1") == "2.20.0"assert asc.last_sent(store(("2.19.3", "DEVELOPER_REJECTED")), "2.19.4") is Noneprint("ok")++# Xcode Cloud never heard of v2.20.4's tag (tagged commit abc): main on that commit builds the same source.+def git_with_main_at(sha):+ return lambda cmd, *args: {"rev-list": "abc", "ls-remote": f"{sha}\trefs/heads/main"}[cmd]+++refs = {"refs/heads/main": "m", "refs/tags/v2.20.3": "t"}+asc.git = git_with_main_at("abc")+assert asc.archive_ref("v2.20.3", refs) == "refs/tags/v2.20.3"+assert asc.archive_ref("v2.20.4", refs) == "refs/heads/main"+asc.git = git_with_main_at("def")+assert asc.archive_ref("v2.20.4", refs) is None # main moved on: wait for the tag+asc.git = lambda *args: ""+assert asc.archive_ref("v2.20.4", refs) is None # tag or main unknown: never guess main+print("ok")diff --git a/tools/asc-submit.py b/tools/asc-submit.pyindex e12d4732..a6077e25 100755--- a/tools/asc-submit.py+++ b/tools/asc-submit.py@@ -7,8 +7,9 @@ SINCE (ISO 8601) ignores builds uploaded before it, so a tag run never submits aRuns in a checkout with the release tags.A release whose tag changes nothing the iPhone app is built from since the last version sent-to App Review is skipped (FORCE=1 ships it anyway). Otherwise it starts the Xcode Cloud archive-on the tag (only when SINCE is set or no build of the version exists yet) and waits for it.+to App Review is skipped (FORCE=1 ships it anyway). Otherwise, when SINCE is set or no build of+the version exists yet, it starts the Xcode Cloud archive on the tag (or on main while main is the+tagged commit), then waits for the build.What's New comes from the version's section in apps/ios/WhatsNew.md, else from the"## What's New" bullets of the PRs merged since the last App Store version (PRS: `gh pr list@@ -146,15 +147,31 @@ def last_sent(versions, version):and v["attributes"]["appVersionState"] not in UNSENT), None)+def archive_ref(tag, refs):+ """Which of Xcode Cloud's refs ({canonical name: id}) to archive `tag` from: the tag, else main+ while main is the tagged commit. Xcode Cloud hears of a new tag through a GitHub webhook that+ sometimes never comes (v2.20.4)."""+ if f"refs/tags/{tag}" in refs:+ return f"refs/tags/{tag}"+ sha = git("rev-list", "-n", "1", tag)+ main = git("ls-remote", "origin", "refs/heads/main").split("\t")[0]+ return "refs/heads/main" if sha and sha == main and "refs/heads/main" in refs else None++def start_archive(tag):repo = call("GET", f"/ciWorkflows/{WORKFLOW_ID}/repository")["data"]["id"]- ref = wait_for(f"Xcode Cloud to see {tag}", lambda: next((- r["id"] for r in all_pages(f"/scmRepositories/{repo}/gitReferences?limit=200")- if r["attributes"]["canonicalName"] == f"refs/tags/{tag}"), None), 15)++ def source():+ refs = {r["attributes"]["canonicalName"]: r["id"]+ for r in all_pages(f"/scmRepositories/{repo}/gitReferences?limit=200")}+ name = archive_ref(tag, refs)+ return name and (name, refs[name])++ name, ref = wait_for(f"Xcode Cloud to see {tag}", source, 15)run = call("POST", "/ciBuildRuns", {"data": {"type": "ciBuildRuns", "relationships": {"workflow": {"data": {"type": "ciWorkflows", "id": WORKFLOW_ID}},"sourceBranchOrTag": {"data": {"type": "scmGitReferences", "id": ref}}}}})["data"]- print(f"started Xcode Cloud build {run.get('attributes', {}).get('number', run['id'])} on {tag}")+ print(f"started Xcode Cloud build {run.get('attributes', {}).get('number', run['id'])} on {name}")def main(version):