Publishing as a Swift package
Publish your public-facing Fern Swift SDK as a Swift package distributed via Git. After following the steps on this page, you’ll have a versioned package that developers can install using Swift Package Manager.
This page assumes that you have:
- An initialized
fern
folder. See Set up thefern
folder. - A GitHub repository for your SDK. See Project Structure.
Configure generators.yml
Publish as a Swift package
At this point, you’re ready to generate a release for your SDK.
Generate your release
Regenerate your SDK and publish it to your repository:
Local machine output will verify that the release is pushed to your repository and tagged with the version you specified.
Verify package availability
Your Swift package is now available! Developers can add it to their projects by:
- In Xcode: File → Add Package Dependencies → Enter your repository URL
- In Package.swift: Add to dependencies array:
Unlike other languages that rely on centralized registries, Swift packages are available as soon as they’re tagged and pushed to a Git repository.
You can optionally submit your package to the community-maintained Swift Package Index for better discoverability.