Skip to main content

Releasing Updates

This guide covers the process of releasing updates to your React Native application using Source Push.

Understanding Updates

Source Push updates can include:

  • JavaScript code changes
  • Asset changes (images, fonts, etc.)
  • Configuration changes

Updates cannot include:

  • Native code changes
  • Changes to the app binary
  • Updates to native dependencies

Release Process

Basic Release

The simplest way to release an update is using the release-react command:

srcpush release-react MyApp-iOS ios
srcpush release-react MyApp-Android android

Release with Options

srcpush release-react MyApp-iOS ios \
--description "Bug fixes and performance improvements" \
--mandatory \
--target-binary-version "1.0.0" \
--rollout 25

Common options include:

  • --description: Update description
  • --mandatory: Force users to accept the update
  • --target-binary-version: Target specific app versions
  • --rollout: Percentage of users to receive the update
  • --development: Bundle in development mode

Deployment Strategies

Multi-Environment Deployment

  1. Release to Staging:

    srcpush release-react MyApp ios -d Staging
  2. Test in Staging

  3. Promote to Production:

    srcpush promote MyApp Staging Production

Staged Rollouts

Release to a percentage of users:

# Initial rollout to 25% of users
srcpush release-react MyApp ios --rollout 25

# Increase rollout to 50%
srcpush patch MyApp Production -r 50

# Complete rollout
srcpush patch MyApp Production -r 100

Version Targeting

Target specific app versions:

# Target exact version
srcpush release-react MyApp ios --target-binary-version "1.0.0"

# Target version range
srcpush release-react MyApp ios --target-binary-version "1.0.0 - 1.1.0"

# Target using semver
srcpush release-react MyApp ios --target-binary-version "~1.0.0"

Monitoring Updates

Check Deployment History

srcpush deployment history MyApp Production

View Release Metrics

srcpush deployment metrics MyApp Production

Rollback Strategies

Immediate Rollback

# Rollback the latest release
srcpush rollback MyApp Production

# Rollback to a specific release
srcpush rollback MyApp Production --target-release v5

Gradual Rollback

  1. Release new update with limited rollout:

    srcpush release-react MyApp ios --rollout 10
  2. Monitor for issues

  3. If issues found, rollback:

    srcpush rollback MyApp Production
  4. If no issues, increase rollout:

    srcpush patch MyApp Production -r 100

Best Practices

  1. Always Test in Staging:

    srcpush release-react MyApp ios -d Staging
  2. Use Descriptive Labels:

    srcpush release-react MyApp ios \
    --description "Fixed crash in profile screen" \
    --label "v1.2.3-beta"
  3. Implement Proper Error Handling:

    codePush.sync({
    installMode: codePush.InstallMode.ON_NEXT_RESTART,
    rollbackRetryOptions: {
    maxRetryAttempts: 3,
    },
    });
  4. Use Mandatory Updates Sparingly: Only mark updates as mandatory for critical bug fixes or security issues.

Troubleshooting

Common Issues

  1. Update Not Installing:

    • Check target binary version
    • Verify deployment key
    • Check device logs
  2. Bundle Errors:

    • Ensure all dependencies are installed
    • Check for syntax errors
    • Verify asset paths
  3. Rollback Issues:

    • Check previous release availability
    • Verify client configuration
    • Review error logs

Next Steps