Skip to content
Xerobi Icons

Publishing the Swift package

No registry: Swift Package Manager reads the git tag.

Last updated

There is no registry to publish to. Swift Package Manager reads the package from the git repository: the tag is the release.

  • Package.swift lives at the repository root and points at packages/swift/Sources/XerobiIcons. The generator writes both, and both must be committed on the tagged commit.

  • Consumers add the package by URL:

    .package(url: "https://github.com/xerobi/xerobi-icons", from: "0.1.0")

    Tags may be 0.1.0 or v0.1.0; SwiftPM accepts both.

One-time setup

  1. Repository public at github.com/xerobi/xerobi-icons.
  2. Check it resolves from a clean machine (Xcode: File → Add Package Dependencies with the URL, or in a scratch package swift package resolve). It clones the whole repository, so keep the repository size in mind.
  3. Optional but recommended: list it on the Swift Package Index (<https://swiftpackageindex.com/add-a-package>): it gives search, docs and platform compatibility badges. It is a pull request to their PackageList repository, or the form on that page.

Per release

Nothing to upload. The swift job in release.yml checks out the tag on macOS and runs swift build, so a tag that does not build is noticed immediately.

Common errors

Symptom Fix
Xcode: “package product not found” Package.swift or packages/swift missing on the tagged commit: regenerate, commit, recreate the tag
Resolution is slow The repository is large (6,054 icons in an asset catalog). Consider a lighter dedicated repository later
swift build fails only in CI macOS runner’s Xcode version differs: pin one in the workflow with maxim-lobanov/setup-xcode