Publishing a Swift package is as simple as committing code, tagging it, and pushing it up to a git repository. To publish the package, perform the following steps:
- Create a public git repository on github.com.
- Open the Terminal and change your directory to your package's path, cd /path/to/your/swift/package. Then initialize the git repository by running the git init command.
- Add a remote origin to the local git repo by running this command:
git remote add origin git@github.com:<repoaccount>/<reponame>.git
- Make sure to replace the repo account and repo name with the one you created in Step 1.
- Add all files to this repo using git add . and commit them using git commit -m "Initial Commit".
- Tag it with a version. ...