You can create a local Swift package in Xcode. If you want to publish an existing package, go to Publish a Swift package.
Choose File > New > Swift Package.
In the sheet that appears, enter a name for the package in the Save As field, select a location for the project below.
If “Create Git repository on my Mac” is enabled, select it to use source control (recommended).
To add the package to another project, choose the project from the “Add to” menu, then choose a group in the project from the Group menu.
Click Create.
To learn more, go to Creating a Swift Package with Xcode.