cocoapods-publishing-workflow
Use when publishing CocoaPods libraries to CocoaPods Trunk. Covers pod trunk registration, podspec validation, version management, and publishing best practices for successful library distribution.
What this skill does
# CocoaPods - Publishing Workflow Complete guide to publishing your CocoaPods library to the official CocoaPods Trunk. ## Publishing Overview ### Process Steps 1. **Register with CocoaPods Trunk** (one-time) 2. **Prepare your podspec** 3. **Validate locally** (`pod lib lint`) 4. **Validate for publishing** (`pod spec lint`) 5. **Tag version in git** 6. **Push to Trunk** (`pod trunk push`) ## Trunk Registration ### Register Email (One-Time) ```bash # Register your email pod trunk register [email protected] 'Your Name' # Verify email (check inbox for verification link) # Click link in email to activate account ``` ### Check Registration ```bash # Verify registration pod trunk me # Sample output: # - Name: Your Name # - Email: [email protected] # - Since: January 1st, 2024 # - Pods: None ``` ## Podspec Preparation ### Version Management ```ruby Pod::Spec.new do |spec| # Semantic versioning: MAJOR.MINOR.PATCH spec.version = '1.0.0' # Must match git tag spec.source = { :git => 'https://github.com/username/MyLibrary.git', :tag => spec.version.to_s } end ``` ### Required Metadata ```ruby Pod::Spec.new do |spec| # Identity (required) spec.name = 'MyLibrary' spec.version = '1.0.0' # Description (required) spec.summary = 'Brief one-line description' spec.description = 'Longer description with more details about what the library does' # Links (required) spec.homepage = 'https://github.com/username/MyLibrary' spec.source = { :git => 'https://github.com/username/MyLibrary.git', :tag => spec.version.to_s } # License (required) spec.license = { :type => 'MIT', :file => 'LICENSE' } # Authors (required) spec.authors = { 'Your Name' => '[email protected]' } # Platform (required) spec.ios.deployment_target = '13.0' end ``` ## Local Validation ### Quick Validation ```bash # Fast validation (skips build) pod lib lint --quick # Check for common issues without full build ``` ### Full Validation ```bash # Complete validation with build pod lib lint # With Swift version pod lib lint --swift-version=5.9 # Verbose output pod lib lint --verbose ``` ### Handle Warnings ```bash # Allow warnings (not recommended for new pods) pod lib lint --allow-warnings # Better: Fix warnings pod lib lint # Address each warning individually ``` ## Publishing Validation ### Spec Lint ```bash # Validate podspec for publishing pod spec lint # Validates against remote repository # Simulates real-world installation ``` ### Pre-Publishing Checklist - [ ] All tests pass - [ ] No lint warnings - [ ] Privacy manifest included (iOS 17+) - [ ] README is complete - [ ] LICENSE file exists - [ ] CHANGELOG updated - [ ] Version number is correct - [ ] Git repository is clean ## Git Tagging ### Create Tag ```bash # Stage all changes git add . # Commit changes git commit -m "Release version 1.0.0" # Create tag matching podspec version git tag 1.0.0 # Push to remote with tags git push origin main --tags ``` ### Tag Format ```bash # Semantic versioning git tag 1.0.0 # MAJOR.MINOR.PATCH git tag 1.0.0-beta.1 # Pre-release git tag 1.0.0-rc.1 # Release candidate # Must match spec.version in podspec ``` ## Publishing to Trunk ### Push Pod ```bash # Push to CocoaPods Trunk pod trunk push MyLibrary.podspec # With specific Swift version pod trunk push MyLibrary.podspec --swift-version=5.9 # Allow warnings (not recommended) pod trunk push MyLibrary.podspec --allow-warnings ``` ### Successful Publish Output ``` Validating podspec -> MyLibrary (1.0.0) Updating spec repo `trunk` -> MyLibrary (1.0.0) -------------------------------------------------------------------------------- ๐ Congrats ๐ MyLibrary (1.0.0) successfully published ๐ January 1st, 2024 ๐ https://cocoapods.org/pods/MyLibrary ๐ Tell your friends! -------------------------------------------------------------------------------- ``` ## Version Updates ### Patch Release (Bug Fixes) ```ruby # In podspec spec.version = '1.0.1' # Was 1.0.0 ``` ```bash # Git workflow git add . git commit -m "Fix: Resolve crash in background mode" git tag 1.0.1 git push origin main --tags pod trunk push MyLibrary.podspec ``` ### Minor Release (New Features) ```ruby # In podspec spec.version = '1.1.0' # Was 1.0.1 ``` ```bash # Git workflow git add . git commit -m "Add: Support for custom themes" git tag 1.1.0 git push origin main --tags pod trunk push MyLibrary.podspec ``` ### Major Release (Breaking Changes) ```ruby # In podspec spec.version = '2.0.0' # Was 1.1.0 ``` ```bash # Git workflow git add . git commit -m "BREAKING: Refactor API for modern Swift" git tag 2.0.0 git push origin main --tags pod trunk push MyLibrary.podspec ``` ## Managing Multiple Pods ### List Your Pods ```bash # View all your published pods pod trunk me # Shows: # - Pods: # - MyLibrary # - MyOtherLibrary ``` ### Add Contributors ```bash # Add team member to pod pod trunk add-owner MyLibrary [email protected] # Remove contributor pod trunk remove-owner MyLibrary [email protected] ``` ## Deprecation ### Deprecate Old Version ```bash # Deprecate specific version pod trunk deprecate MyLibrary --version=1.0.0 # Deprecate entire pod pod trunk deprecate MyLibrary ``` ### Deprecation with Replacement ```ruby # In podspec spec.deprecated = true spec.deprecated_in_favor_of = 'NewAwesomeLibrary' ``` ## Common Issues ### Issue: Tag Doesn't Match ``` ERROR | [MyLibrary] The repo has no tag for version 1.0.0 ``` **Solution:** ```bash # Create and push tag git tag 1.0.0 git push origin --tags ``` ### Issue: Validation Fails ``` ERROR | [MyLibrary] xcodebuild: Returned an unsuccessful exit code ``` **Solution:** ```bash # Run detailed validation pod lib lint --verbose # Fix errors shown in output # Re-validate until clean ``` ### Issue: Missing License ``` ERROR | [MyLibrary] Missing required attribute `license` ``` **Solution:** ```ruby # Add to podspec spec.license = { :type => 'MIT', :file => 'LICENSE' } ``` ```bash # Create LICENSE file in repo root ``` ## Best Practices ### Pre-Publish Testing ```bash # 1. Test in example app cd Example pod install # Run app, verify functionality # 2. Test in real project # Create test project, add pod from local path pod 'MyLibrary', :path => '../MyLibrary' # 3. Validate pod lib lint pod spec lint ``` ### Version Numbering ```ruby # Follow semantic versioning strictly spec.version = '1.0.0' # Initial release spec.version = '1.0.1' # Bug fix spec.version = '1.1.0' # New feature spec.version = '2.0.0' # Breaking change ``` ### CHANGELOG ```markdown # Changelog ## [1.1.0] - 2024-01-15 ### Added - Custom theme support - Dark mode compatibility ### Fixed - Memory leak in background processing ## [1.0.0] - 2024-01-01 - Initial release ``` ### README ```markdown # MyLibrary Brief description of library. ## Installation \`\`\`ruby pod 'MyLibrary', '~> 1.0' \`\`\` ## Usage \`\`\`swift import MyLibrary let library = MyLibrary() library.doSomething() \`\`\` ## Requirements - iOS 13.0+ - Swift 5.7+ ## License MyLibrary is available under the MIT license. ``` ## Anti-Patterns ### Don't โ Publish without testing ```bash pod trunk push --skip-tests # Risky ``` โ Use `--allow-warnings` for initial release ```bash pod trunk push --allow-warnings # Fix warnings instead ``` โ Forget to tag git ```bash # Missing git tag - publish will fail pod trunk push ``` โ Skip version bump ```ruby # Still version 1.0.0 after changes - confusing spec.version = '1.0.0' ``` ### Do โ Test thoroughly before publishing ```bash pod lib lint pod spec lint # Test in real project ``` โ Fix all warnings ```bash pod lib lint # Address warnings ``` โ Always tag git ```bash git tag 1.0.0 git push --tags ``` โ Bump version for every release ```ruby spec.version = '1.0.1' # Incremented ``` ## Complete Publishing Example ```bash # 1. Prepare podspec vim MyLi
Related in General
modeling-omnistudio-epc-catalog
IncludedSalesforce Industries CME EPC product-modeling skill for Product2-based catalog creation. Use when creating EPC products, configuring product attributes, building offer bundles with Product Child Items, or reviewing EPC DataPack JSON metadata for product catalog changes. TRIGGER when: user creates or updates Product2 EPC records, AttributeAssignment payloads, AttributeMetadata/AttributeDefaultValues, Offer bundles, or ProductChildItem relationships. DO NOT TRIGGER when: designing OmniScripts/FlexCards/Integration Procedures (use building-omnistudio-omniscript, building-omnistudio-flexcard, or building-omnistudio-integration-procedure), implementing Apex business logic (use generating-apex), or troubleshooting deployment pipelines (use deploying-metadata).
relationship-science-coach
IncludedUse this skill for direct, practical adult relationship coaching: couples conflict, repair, trust, marriage, dating, flirting, attachment patterns, emotional connection, sex, desire differences, eroticism, kink negotiation, affection, love languages, breakups, and long-term passion. Draw on Gottman, EFT and Hold Me Tight, attachment science, modern sex research, Perel, Nagoski, Kerner, Schnarch, Love and Stosny, and flexible love-language tools. Be concrete and low-hedge. Redirect only for imminent danger, abuse, coercive control, minors, non-consent, self-harm, stalking, or medical/legal/psychiatric decisions.
building-sf-integrations
IncludedSalesforce integration architecture and runtime plumbing with 120-point scoring. Use this skill to set up Named Credentials, External Credentials, External Services, REST/SOAP callout patterns, Platform Events, and Change Data Capture. TRIGGER when: user sets up Named Credentials, External Services, REST/SOAP callouts, Platform Events, CDC, or touches .namedCredential-meta.xml files. DO NOT TRIGGER when: Connected App/OAuth config (use configuring-connected-apps), Apex-only logic (use generating-apex), or data import/export (use handling-sf-data).
venue-templates
IncludedAccess comprehensive LaTeX templates, formatting requirements, and submission guidelines for major scientific publication venues (Nature, Science, PLOS, IEEE, ACM), academic conferences (NeurIPS, ICML, CVPR, CHI), research posters, and grant proposals (NSF, NIH, DOE, DARPA). This skill should be used when preparing manuscripts for journal submission, conference papers, research posters, or grant proposals and need venue-specific formatting requirements and templates.
let-fate-decide
IncludedDraws the 12 Houses of the Zodiac Tarot spread to inject entropy into planning when prompts are vague, ambiguous, or casually delegated. Interprets the spread to guide next steps. Use when the user says 'let fate decide', 'YOLO', 'whatever', 'idk', or other nonchalant phrases, makes Yu-Gi-Oh references, or when you are about to arbitrarily pick between multiple reasonable approaches. Prefer over ask-questions-if-underspecified when the user's tone is casual or playful rather than precision-seeking.
net-ops
IncludedCross-platform network troubleshooting (Windows, macOS, Linux) via local or remote shell. Use for: DNS broken, can't resolve hostnames, nslookup/dig works but apps fail, NRPT, WFP, scutil, /etc/resolver, systemd-resolved, /etc/resolv.conf, NetworkManager, VPN DNS leak residue (ProtonVPN/Mullvad/WireGuard/AnyConnect), AV/firewall blocking DNS or DoH, Tailscale DNS interaction, intermittent connectivity, remote diagnostics over SSH.