Skip to content

Conversation

@jasonpraful
Copy link
Member

Add ci to automate SDK version bumps

flowchart TD
    A[🚀 Workflow Triggered] --> B[🔍 Checkout Repository]
    B --> E[🔍 Get Current Versions]
    
    E --> E1[📱 Extract iOS version<br/>from podspec]
    E --> E2[🤖 Extract Android version<br/>from build.gradle]
    
    E1 --> F[🚀 Get Latest Releases]
    E2 --> F
    
    F --> F1[📱 Fetch iOS release<br/>from intercom/intercom-ios]
    F --> F2[🤖 Fetch Android release<br/>from intercom/intercom-android]
    
    F1 --> G[🧮 Analyze Update Requirements]
    F2 --> G
    
    G --> G1{📱 iOS needs update?<br/>Current ≠ Latest & Latest ≠ null}
    G --> G2{🤖 Android needs update?<br/>Current ≠ Latest & Latest ≠ null}
    
    G1 -->|No| H1[ℹ️ iOS up to date]
    G1 -->|Yes| H2[✅ iOS update needed]
    G2 -->|No| H3[ℹ️ Android up to date]
    G2 -->|Yes| H4[✅ Android update needed]
    
    H1 --> I{Any updates needed?}
    H2 --> I
    H3 --> I
    H4 --> I
    
    I -->|No| Z[🎯 Exit cleanly<br/>No updates needed]
    I -->|Yes| J[🔍 Check Existing PRs]
    
    J --> J1[📋 Search for open PRs<br/>with update Intercom SDK dependencies]
    
    J1 --> K{Existing PRs found?}
    
    K -->|No| L[✅ No existing PRs<br/>Proceed with update]
    K -->|Yes| M[🔍 Analyze Each PR]
    
    M --> M1{📱 iOS version matches<br/>target version?}
    M --> M2{🤖 Android version matches<br/>target version?}
    
    M1 -->|Yes| N1[✅ iOS version correct]
    M1 -->|No| N2[❌ iOS version outdated]
    M2 -->|Yes| N3[✅ Android version correct]
    M2 -->|No| N4[❌ Android version outdated]
    
    N1 --> O{Both platforms correct?}
    N2 --> P[🗑️ Close outdated PR<br/>Delete branch]
    N3 --> O
    N4 --> P
    
    O -->|Yes| Q[🎯 Skip PR creation<br/>Existing PR is current]
    O -->|No| P
    
    P --> L
    Q --> Z
    
    L --> R[🔧 Setup Ruby for CocoaPods]
    R --> S[🛠️ Create Update Branch]
    
    S --> T[📝 Update Dependencies]
    
    T --> T1{📱 iOS update needed?}
    T --> T2{🤖 Android update needed?}
    
    T1 -->|Yes| U1[📱 Update podspec<br/>s.dependency Intercom version]
    T1 -->|No| V[📦 Update yarn.lock]
    T2 -->|Yes| U2[🤖 Update build.gradle<br/>intercom-sdk:X.X.X]
    T2 -->|No| V
    
    U1 --> V
    U2 --> V
    
    V --> W[📈 Analyze SDK Version Changes<br/>Determine semver bump type]
    
    W --> W1{📱 iOS major version change?}
    W --> W2{🤖 Android major version change?}
    W --> W3{📱 iOS minor version change?}
    W --> W4{🤖 Android minor version change?}
    
    W1 -->|Yes| X1[📈 Major bump X.0.0]
    W2 -->|Yes| X1
    W3 -->|Yes and no major| X2[📈 Minor bump X.Y.0]
    W4 -->|Yes and no major| X2
    W1 -->|No| W3
    W2 -->|No| W4
    W3 -->|No| X3[📈 Patch bump X.Y.Z]
    W4 -->|No| X3
    
    X1 --> Y1[📝 Update package.json version]
    X2 --> Y1
    X3 --> Y1
    
    Y1 --> Z1[📦 Update iOS Examples<br/>pod install in example dirs]
    Z1 --> A1[💾 Commit Changes]
    
    A1 --> A2[💾 Create commit with<br/>Version changes<br/>Lockfile updates<br/>Example updates<br/>Semver bump]
    A2 --> A3[🚀 Push branch to origin]
    
    A3 --> B1[🎯 Create Pull Request]
    
    B1 --> B2[📝 Build PR description with<br/>Version changes summary<br/>iOS/Android changelogs<br/>Semver bump info<br/>Testing checklist]
    B2 --> B3[🎯 Create PR with title<br/>chore update Intercom SDK dependencies<br/>with version changes]
    
    B3 --> B4{PR created successfully?}
    
    B4 -->|Yes| C1[✅ Success Summary<br/>PR created with updates]
    B4 -->|No| C2[❌ Failed Summary<br/>Branch pushed, manual PR needed]
    
    C1 --> Z
    C2 --> Z
    
    Z --> CC[📊 Workflow Complete]
    
    style A fill:#e1f5fe
    style Z fill:#e8f5e8
    style CC fill:#e8f5e8
    style Q fill:#fff3e0
    style G1 fill:#f3e5f5
    style G2 fill:#f3e5f5
    style I fill:#f3e5f5
    style K fill:#f3e5f5
    style O fill:#f3e5f5
Loading

@jasonpraful jasonpraful changed the title add ci to automate ios sdk package bump add ci to automate ios/android sdk package bump Sep 5, 2025
Copy link

@EmmanuelIntercom EmmanuelIntercom left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice! Might be worth experimenting on a test repository if you haven't already done so.

@jasonpraful jasonpraful marked this pull request as ready for review September 8, 2025 10:19
@jasonpraful
Copy link
Member Author

Nice! Might be worth experimenting on a test repository if you haven't already done so.

Thanks! Tests were conducted in a sandbox environment :D

@jasonpraful jasonpraful merged commit c662ad4 into main Sep 8, 2025
8 checks passed
@jasonpraful jasonpraful deleted the jason/automate-package-bumps branch September 8, 2025 10:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants