Skip to content

docs: DocC API docs #338

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Apr 30, 2025
Merged

docs: DocC API docs #338

merged 3 commits into from
Apr 30, 2025

Conversation

watt
Copy link
Collaborator

@watt watt commented Apr 29, 2025

Adds DocC generated API docs, published here, and removes the old doc generation pipeline.

Checklist

  • Unit Tests
  • UI Tests
  • Snapshot Tests (iOS only)
  • I have made corresponding changes to the documentation

@watt watt changed the title ci: DocC API docs docs: DocC API docs Apr 30, 2025
@@ -60,7 +60,7 @@ let package = Package(
.package(url: "https://github.com/ReactiveCocoa/ReactiveSwift.git", from: "7.1.1"),
.package(url: "https://github.com/ReactiveX/RxSwift.git", from: "6.6.0"),
.package(url: "https://github.com/swiftlang/swift-syntax", "509.0.0" ..< "601.0.0-prerelease"),
.package(url: "https://github.com/pointfreeco/swift-case-paths", from: "1.1.0"),
.package(url: "https://github.com/pointfreeco/swift-case-paths", from: "1.5.5"),
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bumped to fix an issue with compiling under Xcode 16.3.

@watt watt marked this pull request as ready for review April 30, 2025 01:44
@watt watt requested a review from a team as a code owner April 30, 2025 01:44
Copy link
Contributor

@jamieQ jamieQ left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the new docs look amazing – nice work! left some minor thoughts, and one final question: i assume the existing docs lint check is not going to pass this go-around since the script was removed in this PR, but subsequently the check will no longer occur – does that sound right?

run: Scripts/generate_docs.sh

- name: Deploy to GitHub Pages
uses: crazy-max/ghaction-github-pages@df5cc2bfa78282ded844b354faee141f06b41865
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is this the crazy-max we need or deserve? j/k, but how did you pick this flavor of page deployment? TCA repo uses this one, which 'wins' the GH star popularity contest (i don't know enough to know if they are comparable/equivalent though).

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This file is copied from swift-modals, which is in turn based on Blueprint's. We've been using this action to publish Blueprint's jazzy docs for about 5 years. I couldn't tell you what the playing field looked like back then, but I know it's been reliable.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When I was setting up swift-modals CI jobs I got some security warnings that suggested using SHAs instead of tags, so that's why they're versioned that way.

- name: Checkout
uses: actions/checkout@v4
- uses: jdx/mise-action@5083fe46898c414b2475087cc79da59e7da859e8
- uses: maxim-lobanov/setup-xcode@60606e260d2fc5762a71e64e74b2174e8ea3c8bd
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is this the only place we use this? what does it do differently than how we set things up in the swift workflow?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Effectively the same thing AFAIK, just a little more configuration-based style of definition than running sudo xcode-select inline.


env:
# Xcode 16.3 gets us Swift 6.1, required for docc merge
XCODE_VERSION: 16.3
Copy link
Contributor

@jamieQ jamieQ Apr 30, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

tangential thought – i wonder if we could do doc generation without Xcode in a reasonably-straightforward way now that 'swiftly' is a thing.

edit: or perhaps i'm wildly mistaken and docc is an Xcode toolchain rather than Swift toolchain thing?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can, and I started out that way, but it's not really better since Xcode 16.3 is preinstalled while swiftly has to download it on every run. fwiw I also found it annoying to have swiftly installed locally and uninstalled it.

If you want to try it on something, I saved the snippet:

        # Get Swift 6.1 for docc merge
      - name: Install Swiftly and Swift 6.1
        run: |
          curl -O "https://download.swift.org/swiftly/darwin/swiftly.pkg"
          installer -pkg swiftly.pkg -target CurrentUserHomeDirectory
          # the swiftly binary is extracted to ~/local/bin/swiftly on macOS
          ~/.swiftly/bin/swiftly init --verbose --assume-yes --skip-install
          . ~/.swiftly/env.sh
          hash -r
          swiftly install 6.1.0 --use
          hash -r
          which docc

Vapor also has a swiftly github action but it only supports linux.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also, you still need to use xcodebuild docbuild to build the documentation since it imports UIKit. Swiftly will only get you a docc that's independent from xccrun docc for manipulating the docc archives.

@watt
Copy link
Collaborator Author

watt commented Apr 30, 2025

i assume the existing docs lint check is not going to pass this go-around since the script was removed in this PR, but subsequently the check will no longer occur – does that sound right?

Right. I will need to disable the requirement first in order to merge this PR, and then it'll be gone.

@watt watt merged commit 3fa55ff into main Apr 30, 2025
11 checks passed
@watt watt deleted the awatt/docc branch April 30, 2025 23:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants