Overview
The registry provides:- Private package hosting: Host internal Swift packages
- Version management: Semantic versioning support
- Access control: Organization-level permissions
- Fast downloads: CDN-backed distribution
- SPM compatibility: Works with Swift Package Manager
Prerequisites
- Authenticate with Tuist Cloud
- A Swift package to publish
- Access to a Tuist organization
Setting Up the Registry
Initialize Registry Configuration
Run the setup command in your project:- Xcode projects:
.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/configuration/registries.json - Workspaces:
.xcworkspace/xcshareddata/swiftpm/configuration/registries.json - SPM packages:
.swiftpm/configuration/registries.json
Configuration File
The generatedregistries.json looks like:
Commit this file to version control so your team uses the same registry configuration.
Registry Authentication
Login to Registry
Authenticate with the registry:- Uses your Tuist Cloud credentials
- Generates a registry-specific token
- Stores it in SPM’s credential store
Verify Authentication
Check your authentication status:Logout
Remove registry credentials:Publishing Packages
Prepare Your Package
Ensure your package has:- A valid
Package.swift - Semantic version tags
- Proper package metadata
Package.swift:
Package.swift
Tag a Release
Create a version tag:Publish to Registry
Publish your package:Consuming Packages
Add Dependency
After runningtuist registry setup, add the package to your Package.swift:
Package.swift
Using in Xcode
In Xcode projects:- Run
tuist registry setupto configure the registry - Add the package using Xcode’s package manager UI
- Search for
your-org.MyPrivatePackage - Select the version
- Add to your target
Using with Tuist
In Tuist projects, add to yourPackage.swift dependencies:
Project.swift
Package Management
List Packages
View packages in your registry:Package Details
Get information about a package:- Available versions
- Publication dates
- Download statistics
- Dependencies
Delete a Version
Remove a specific version:Package Scoping
Organization Packages
Packages are scoped to organizations:- Publish packages under that organization
- Access private packages
Package Naming
Follow Swift package naming conventions:- Use PascalCase:
MyPrivatePackage - Avoid special characters
- Keep names concise
- Include organization scope:
your-org.MyPrivatePackage
CI/CD Integration
Publishing from CI
Automate package publishing:.github/workflows/publish.yml
Consuming in CI
Use registry packages in CI:.github/workflows/build.yml
Package Discovery
Search Packages
Search for packages in your organization:Browse in Web UI
View packages in the Tuist Cloud dashboard:- All published packages
- Version history
- Download statistics
- Package dependencies
- README and documentation
Advanced Features
Package Metadata
Include rich metadata in your package:Package.swift
Package Documentation
Include a README for your package:README.md
Usage
After (Registry)
Package.swift
- Faster resolution (no git clones)
- Better caching
- Centralized management
- Access control
Troubleshooting
Authentication Fails
If registry authentication fails:Package Not Found
If SPM can’t find your package:- Verify
tuist registry setupwas run - Check
registries.jsonis committed - Ensure you’re authenticated:
tuist auth whoami - Verify package exists:
tuist registry list
Publication Fails
If publishing fails:- Verify package name follows conventions
- Check version tag exists
- Ensure you have publish permissions
- Validate
Package.swiftsyntax
Best Practices
Use semantic versioning
Use semantic versioning
Follow semver strictly: major.minor.patch (e.g., 1.0.0).
Include comprehensive README
Include comprehensive README
Document installation, usage, and API in your package README.
Test before publishing
Test before publishing
Always test your package locally before publishing to the registry.
Maintain changelog
Maintain changelog
Keep a CHANGELOG.md documenting changes in each version.
Use organization scoping
Use organization scoping
Always publish packages with your organization scope.
Next Steps
Package Management Guide
Learn more about managing package dependencies
Build Optimization
Optimize build times with package caching