Skip to content

Conversation

@mudigal
Copy link

@mudigal mudigal commented Jan 29, 2026

Adds automated testing for the TypeScript SDK and sets up one-command releases to crates.io and npm.

Closes #210


What's New

🧪 CI Testing (Part 1)

Two new test scripts:

  1. TypeScript SDK Test (sdk_store_big_data.js)

    • Uploads a 64MB file using the SDK
    • Measures performance (speed, chunks, retrieval time)
    • Validates data via IPFS
  2. 3-Way Comparison Test (compare_clients.js)

    • Runs the same test with PAPI, Rust SDK, and TypeScript SDK
    • Shows which is fastest
    • Confirms all three work identically

Both tests now run automatically in CI for Westend and Polkadot.

📦 Release Automation (Part 2)

One tag → full release:

./scripts/bump-sdk-version.sh 0.2.0                                                                                                                                                                                 
git tag sdk-v0.2.0 && git push --tags                                                                                                                                                                               
                                                                                                                                                                                                                    
This automatically:                                                                                                                                                                                                 
- ✅ Validates versions match                                                                                                                                                                                       
- ✅ Runs all tests                                                                                                                                                                                                 
- ✅ Publishes to crates.io                                                                                                                                                                                         
- ✅ Publishes to npm                                                                                                                                                                                               
- ✅ Creates GitHub Release with notes                                                                                                                                                                              
                                                                                                                                                                                                                    
Setup Required:                                                                                                                                                                                                     
Add these secrets to the repository:                                                                                                                                                                                
- CARGO_REGISTRY_TOKEN (get from crates.io)                                                                                                                                                                         
- NPM_TOKEN (get from npmjs.com)                                                                                                                                                                                    
                                                                                                                                                                                                                    
---                                                                                                                                                                                                                 
Files Changed                                                                                                                                                                                                       
                                                                                                                                                                                                                    
Created                                                                                                                                                                                                             
                                                                                                                                                                                                                    
- .github/workflows/release-sdk.yml - Release workflow                                                                                                                                                              
- scripts/bump-sdk-version.sh - Version bump script                                                                                                                                                                 
- examples/sdk_store_big_data.js - TypeScript SDK test                                                                                                                                                              
- examples/compare_clients.js - Comparison test                                                                                                                                                                     
- RELEASING.md - Release guide                                                                                                                                                                                      
- sdk/RELEASE_CHECKLIST.md - Quick reference                                                                                                                                                                        
                                                                                                                                                                                                                    
Modified                                                                                                                                                                                                            
                                                                                                                                                                                                                    
- .github/workflows/integration-test.yml - Added SDK tests                                                                                                                                                          
- examples/justfile - Added test recipes                                                                                                                                                                            
- sdk/rust/Cargo.toml - Added crates.io metadata                                                                                                                                                                    
- sdk/typescript/package.json - Added safety checks                                                                                                                                                                 
                                                                                                                                                                                                                    
---                                                                                                                                                                                                                 
Try It                                                                                                                                                                                                              
                                                                                                                                                                                                                    
Run tests locally:                                                                                                                                                                                                  
cd examples                                                                                                                                                                                                         
TEST_DIR=$(mktemp -d)                                                                                                                                                                                               
just start-services "$TEST_DIR" bulletin-polkadot-runtime                                                                                                                                                           
just run-test-sdk-store-big-data "$TEST_DIR"                                                                                                                                                                        
just run-test-compare-clients "$TEST_DIR"                                                                                                                                                                           
just stop-services "$TEST_DIR"                                                                                                                                                                                      
                                                                                                                                                                                                                    
Test release (dry-run):                                                                                                                                                                                             
- Go to Actions → Release SDK → Run workflow                                                                                                                                                                        
- Set version: 0.2.0, dry_run: true                                                                                                                                                                                 
                                                                                                                                                                                                                    
---                                                                                                                                                                                                                 
Documentation                                                                                                                                                                                                       
                                                                                                                                                                                                                    
Full details in:                                                                                                                                                                                                    
- ../RELEASING.md - Complete release guide                                                                                                                                                                          
- ../examples/SDK_CI_INTEGRATION.md - CI setup details                                                                                                                                                              
                                                                                                                                                                                                                    
This version is:                                                                                                                                                                                                    
- **70% shorter** (from ~2000 words to ~400 words)                                                                                                                                                                  
- **Easier to scan** with clear sections and bullet points                                                                                                                                                          
- **Action-oriented** with "Try It" section                                                                                                                                                                         
- **No redundant information**                                                                                                                                                                                      
- **Preserves all key details** while being much more readable    

…ests

- Add sdk_store_big_data.js test using AsyncBulletinClient
- Add compare_clients.js to test all three implementations (PAPI, Rust SDK, TypeScript SDK)
- Add justfile recipes for running TypeScript SDK and comparison tests
- Add CI workflow steps for both Westend and Polkadot runtimes
- Include performance metrics collection and comparison

This addresses issue #210 by integrating the new SDKs into the CI pipeline
and ensuring 100% compatibility across all client implementations.
- Add GitHub Actions workflow for automated releases
  - Validates version consistency across packages
  - Builds and tests both Rust and TypeScript SDKs
  - Publishes to crates.io and npm
  - Creates GitHub Releases with notes
  - Supports dry-run mode for testing

- Configure Rust SDK for crates.io publishing
  - Add metadata (keywords, categories, documentation)
  - Update README with installation instructions
  - Exclude unnecessary files from package

- Configure TypeScript SDK for npm publishing
  - Add .npmignore for clean packages
  - Add prepublishOnly script for safety
  - Already has proper package.json config

- Add comprehensive release documentation
  - RELEASING.md: Full release process guide
  - sdk/RELEASE_CHECKLIST.md: Quick reference
  - scripts/bump-sdk-version.sh: Version bump automation

- Release workflow features:
  - Semantic versioning validation
  - Multi-platform testing
  - Artifact uploads
  - Automatic release notes generation
  - Token-based authentication (CARGO_REGISTRY_TOKEN, NPM_TOKEN)

Usage:
  ./scripts/bump-sdk-version.sh 0.2.0
  git push origin main
  git tag sdk-v0.2.0
  git push origin sdk-v0.2.0

This addresses issue #210 (release strategy planning).
@mudigal mudigal requested a review from x3c41a January 29, 2026 21:45
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.

2 participants