Releasing and publishing a Swift package
Share a specific version of your package.
Overview
Swift Package Manager expects a package to be remotely shared as a single Git repository, with a tag that conforms to a full semantic version, and a Package.swift manifest in the root of the repository.
To publish a package that is hosted in a Git repository, create and push a semantic version tag. Swift package manager expects the tag to be a full semantic version, that includes major, minor, and patch versions in the tag.
The following commands illustrate adding a tag 1.0.0 and pushing those tags to the remote repository:
$ git tag 1.0.0
$ git push origin --tagsWith the tag in place, other packages can depend on the package you tagged through your source repository. An example of a published package can be found at github.com/apple/example-package-playingcard with multiple releases available.
To read more about adding a dependency to your package, read Adding dependencies to a Swift package.
See Also
Guides
Creating a Swift packageSetting the Swift tools versionAdding dependencies to a Swift packageResolving and updating dependenciesCreating C language targetsUsing build configurationsPackaging based on the version of SwiftBundling resources with a Swift packageGenerating Software Bill of Materials (SBOM)Continuous Integration WorkflowsPluginsModule AliasingUsing a package registryPackage CollectionsUsing shell completion scripts