Skip to content

Instantly share code, notes, and snippets.

@pdarcey
Created April 19, 2024 07:23
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save pdarcey/a3fef8add9ab620443757e5caeba5522 to your computer and use it in GitHub Desktop.
Save pdarcey/a3fef8add9ab620443757e5caeba5522 to your computer and use it in GitHub Desktop.
Using and Updating your own Swift Packages in your Project

Using Your Own Swift Packages in Your Project

Create a Package

  • Create a package using, for example these instructions
  • Save and commit, as necessary
  • Push to Github (or other remote service)
  • Set appropriate access to others
  • See instructions below for publishing a release

Add Package to Your Project

Publish a Release

  • Make changes to package code as normal
  • Make one or more commits
  • When ready for release:
    • commit
    • push to Github (or other remote service) Don't forget to do this!
    • On Github, go to the repo and, in the right-hand column, see Releases.
    • Click on "Create a new release"
    • Create a tag: use the next semver (e.g. 0.1.15) as the tag
    • Give the release a title, generate release notes, and add any other description
    • Check "Set as a pre-release," if appropriate
    • Click on "Publish release"
  • Done

Update packages

After a new release is published:

  • In Xcode, in the project(s) that use the package, File -> Packages -> Update to latest package version
  • If necessary, do a clean build
  • Done!
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment