The recently released [Swift Package Registry API](https://forums.swift.org/t/swift-package-registry-service/37219/2) describes in great detail the protocol to host and distribute Swift packages.