Use xcodebuild docbuild to generate full documentation#27
Conversation
Root cause identified: Using 'docc convert' on standalone Documentation.docc catalog only generates tutorials, not API documentation. When Xcode does Documentation Build locally: - Builds Swift code - Extracts API from code - Creates /documentation/newnav/ with API docs - Adds /tutorials/ from Documentation.docc But our workflow was doing: - xcrun docc convert Documentation.docc (no Swift code build) - Only generates /tutorials/ - Missing /documentation/ directory Solution: Use xcodebuild docbuild - Builds the entire project - Generates both API docs and tutorials - Creates proper /documentation/newnav/ directory - Pass DOCC_HOSTING_BASE_PATH to xcodebuild This should now generate the same structure as local Xcode build, with both /documentation/newnav/ (API) and /tutorials/ (tutorials). The redirect issue was a red herring - the real problem was that we weren't building the Swift code at all, so DocC had no API to document!
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| # Use xcodebuild docbuild to build full documentation including API | ||
| # This will create both /documentation/ (API) and /tutorials/ sections | ||
| # DOCC_HOSTING_BASE_PATH is set in Xcode project, but we can override via environment | ||
| xcodebuild docbuild \ | ||
| -project XcodeProject/NewNav.xcodeproj \ | ||
| -scheme NewNav \ | ||
| -derivedDataPath ./DerivedData \ | ||
| -destination 'generic/platform=iOS' \ | ||
| DOCC_HOSTING_BASE_PATH="$DOCC_HOSTING_BASE_PATH" |
There was a problem hiding this comment.
Avoid iOS device destination requiring code signing
The new doc-build step now runs xcodebuild docbuild with -destination 'generic/platform=iOS'. Building for a physical iOS destination forces code signing, and the NewNav scheme declares DEVELOPMENT_TEAM = P8T2366K8X while the GitHub Actions runner has no certificates for that team. When the workflow executes it will abort with “Signing for 'NewNav' requires a development team” before any DocC archive is produced. Target the iOS simulator or disable signing (CODE_SIGNING_ALLOWED=NO) so the documentation build can succeed in CI.
Useful? React with 👍 / 👎.
xcodebuild docbuild was failing with: No profiles for 'ru.egormerkushev.newnav.NewNav' were found Documentation builds don't need code signing, so disable it: - CODE_SIGN_IDENTITY="" - CODE_SIGNING_REQUIRED=NO - CODE_SIGNING_ALLOWED=NO - Use iOS Simulator destination (doesn't require signing) This matches the pattern used in build.yml for verification builds.
Root cause identified: Using 'docc convert' on standalone Documentation.docc catalog only generates tutorials, not API documentation.
When Xcode does Documentation Build locally:
But our workflow was doing:
Solution: Use xcodebuild docbuild
This should now generate the same structure as local Xcode build, with both /documentation/newnav/ (API) and /tutorials/ (tutorials).
The redirect issue was a red herring - the real problem was that we weren't building the Swift code at all, so DocC had no API to document!