
Run swift package generate-documentation on a Figment Mac, pull the .doccarchive to your workstation with rsync, and either open it in Xcode or serve its static HTML. Which tier you pick depends on what your package imports: a pure Swift library compiles fine on the $29 virtual Intel macOS instance (2 vCPU, 8 GiB RAM, 80 GiB disk); a target that needs arm64 execution, iOS/visionOS simulators, or Xcode 27 belongs on a Figment M-series Mac from $95/month (exact chip, RAM and storage are agreed in your configuration quote). Authoritative references used below: Apple's DocC documentation and the Swift-DocC Plugin repository.
DocC compiles your target as part of generating documentation, so the host must be able to build the module. Match the tier to what you import:
If you also want CI setup, backups, monitoring and 30 minutes of monthly support bundled with one M-series Mac, the Managed Build Mac plan is $249/month; the Managed Mac Team plan ($999/month) adds a second Mac, two CI runners and one hour of monthly support. Physical Intel ($49/month) and physical M-series plans collect configuration requests until supply is confirmed—no instant-provisioning promise here.
If you plan to prepay a year for an Apple-silicon Mac, check the annual line, not just the monthly headline. Two published points on 2026-11-10:
So at listed annual prepay on an M4/16 GB/256 GB config, CloudMac is $141/year less than 12 × $95 at Figment's entry price. What that comparison does not tell you: whether Figment's quoted M-series at $95 is an M4 or an older chip, whether 256 GB is enough for your .doccarchive plus Xcode plus DerivedData, and whether you need the managed-CI inclusions that come with Figment's $249/$999 plans. Ask for the exact spec in writing before deciding.
Clone your package on the rented Mac, then invoke the plugin through Swift Package Manager:
swift package \
--allow-writing-to-directory ./docs \
generate-documentation \
--target MyLibrary \
--output-path ./docs \
--transform-for-static-hosting
--allow-writing-to-directory is the SwiftPM permission gate for plugins that write outside the build folder; without it the plugin aborts. --transform-for-static-hosting rewrites the archive's internal links so a plain file server can serve it. --hosting-base-path <path> adds a URL prefix such as /docs/MyLibrary for GitHub Pages. The plugin exits non-zero on compile failure, so set -e in a wrapper script does the right thing.
For a package with several targets, run the command once per target with distinct --output-path values. Flags that follow generate-documentation are forwarded to the underlying docc tool; see the Swift-DocC Plugin repository for the full list in the version you install.
This script runs the DocC build on a Mac you can reach via SSH (a physical Figment i3 or M-series host with SSH enabled in your configuration), then rsyncs the archive back to your workstation. For the $29 Intel VM, inbound SSH is not available: run the swift package step in the VM's browser-console terminal and upload the archive to object storage you already control, then pull it from there.
#!/usr/bin/env bash
# build-docc.sh
# Usage: ./build-docc.sh user@remote-mac /path/to/package TargetName [/local/output]
set -euo pipefail
REMOTE="$1"
REMOTE_PKG="$2"
TARGET="$3"
LOCAL_OUT="${4:-./doccarchive}"
REMOTE_OUT="/tmp/docc-${TARGET}"
echo "==> Building DocC for ${TARGET} on ${REMOTE}"
ssh "${REMOTE}" "cd '${REMOTE_PKG}' && \
swift package \
--allow-writing-to-directory '${REMOTE_OUT}' \
generate-documentation \
--target '${TARGET}' \
--output-path '${REMOTE_OUT}' \
--transform-for-static-hosting"
mkdir -p "${LOCAL_OUT}"
echo "==> Pulling archive to ${LOCAL_OUT}"
rsync -avz --delete \
"${REMOTE}:${REMOTE_OUT}/${TARGET}.doccarchive" \
"${LOCAL_OUT}/"
echo "==> Done. Open ${LOCAL_OUT}/${TARGET}.doccarchive in Xcode or serve it over HTTP."
The script is a worked example, not a benchmarked pipeline. Run it against your own package and target names; do not assume a .doccarchive path exists before a successful build.
A .doccarchive built with --transform-for-static-hosting contains an index.html and a data/ directory and can be served by any static host.
GitHub Pages:
cp -r ./doccarchive/MyLibrary.doccarchive/* docs/
touch docs/.nojekyll
git add docs/
git commit -m "docs: regenerate MyLibrary"
git push
Local preview with nginx:
docker run --rm -p 8080:80 \
-v "$(pwd)/doccarchive/MyLibrary.doccarchive:/usr/share/nginx/html:ro" \
nginx
Open http://localhost:8080 and confirm navigation, search and symbol pages render before you publish.
Connect a physical Figment M-series or i3 Mac as a GitHub Actions self-hosted runner—see our self-hosted runner guide—and add a documentation job. Secrets stay in GitHub's secret store; do not export the whole environment to a file.
name: Build Documentation
on:
push:
branches: [main]
jobs:
build-docs:
runs-on: [self-hosted, macOS]
steps:
- uses: actions/checkout@v4
- name: Generate DocC
run: |
swift package \
--allow-writing-to-directory ./docs \
generate-documentation \
--target MyLibrary \
--output-path ./docs \
--transform-for-static-hosting
- name: Upload archive
uses: actions/upload-artifact@v4
with:
name: MyLibrary-doccarchive
path: docs/
Harden the runner per GitHub's current self-hosted runner security guidance; only run trusted code on it, since self-hosted runners execute whatever the workflow tells them to.
Pick the tier by what your package imports, not by price alone. Pure Swift and modest build loads fit the $29 Intel VM; Apple-silicon-only toolchains, UIKit simulators or multi-target parallel builds belong on an M-series Mac from $95/month (spec agreed in the quote), or the $249 Managed Build Mac if you want the CI setup, backups, monitoring and 30 minutes of monthly support bundled. Request a configuration or get started now.
Related guides: