Skip to content

chore: add SDK version updater script and bump workflow#1853

Open
ygit wants to merge 8 commits into
developfrom
chore/add-sdk-version-updater
Open

chore: add SDK version updater script and bump workflow#1853
ygit wants to merge 8 commits into
developfrom
chore/add-sdk-version-updater

Conversation

@ygit

@ygit ygit commented Apr 30, 2026

Copy link
Copy Markdown
Member

Summary

  • Adds scripts/update-sdk-versions.sh: a bash one-shot to bump native SDK versions in sdk-versions.json and Flutter package versions in lock-step across hmssdk_flutter, hms_room_kit, and their example apps.
  • Adds .github/workflows/bump-sdk-versions.yml: a workflow_dispatch GitHub Action that exposes the script with form inputs and opens a PR via peter-evans/create-pull-request@v6.
  • Adds an update-sdk-versions entry to scripts/package.json so the script can be invoked as npm --prefix scripts run update-sdk-versions -- ....

Mirrors the equivalent script that just shipped in 100ms-react-native, adapted for the Flutter monorepo's pubspec.yaml + JSON structure.

What the script does

  1. Updates packages/hmssdk_flutter/lib/assets/sdk-versions.json (the Podspec and Android build.gradle read this programmatically — they're not edited).
  2. Bumps version in packages/hmssdk_flutter/pubspec.yaml + its example.
  3. Bumps version in packages/hms_room_kit/pubspec.yaml + its example.
  4. Always syncs hms_room_kit's hmssdk_flutter: dependency to the resolved hmssdk_flutter version (auto-corrects drift; preserves ^/~/exact operator).
  5. Maintains lockstep between sdk-versions.json.flutter and the hmssdk_flutter pubspec version.
  6. Runs flutter pub get in 4 dirs in parallel to refresh pubspec.lock files.
  7. Reuses the existing scripts/update-changelog-versions.js to refresh the version block at the bottom of ExampleAppChangelog.txt.
  8. Prints a suggested conventional-commit message and a pod install reminder when iOS native versions changed.

The script does not commit or push — final review is left to the user. Sample apps under sample apps/ are intentionally not touched.

Flags

Flag Notes
--ios-sdk, --android-sdk, --ios-broadcast, --ios-hls, --ios-noise-cancel Native SDK fields in sdk-versions.json
--hmssdk-bump, --room-kit-bump skip|patch|minor|major package bumps
--dry-run Print preview and exit (no writes, no install, no changelog)
--no-install Skip flutter pub get
--yes, --force, --help Standard non-interactive / dirty-tree-override / usage

Test plan

  • bash scripts/update-sdk-versions.sh --help renders correctly
  • Invalid semver (--ios-sdk foo) and invalid bump kind (--hmssdk-bump bogus) rejected before any write
  • --dry-run full bump prints preview, makes zero file changes
  • No-op run with current values produces zero file changes
  • Drift-only run (e.g. hms_room_kit/example was at 1.2.0 while package was at 1.2.1) auto-corrects without touching unchanged files
  • Full bump real run: 5 source files modified + auto-managed changelog block; pubspec formatting (comments, indentation, dependency block order) preserved
  • Lockstep invariant holds: sdk-versions.json.flutter always matches the hmssdk_flutter pubspec version after a run
  • Smoke-test the workflow via GitHub Actions UI after merge (workflow_dispatch with patch bumps)

Notes for reviewers

  • A release-apps.sh GitHub Action workflow (with macOS runner, code signing, secrets setup doc) is intentionally deferred to a separate PR. Notes for that work are kept locally.
  • The .claude/skills/update-sdk-versions.md Claude skill that mirrors this script is on the author's local machine but excluded from the PR (.claude/ is in the author's global gitignore).

🤖 Generated with Claude Code

sapta100ms and others added 4 commits April 14, 2026 12:57
One-shot bash script + GitHub Action to keep sdk-versions.json, the four
pubspec.yaml files, and hms_room_kit's hmssdk_flutter dependency in sync
on each native SDK release.

Script (scripts/update-sdk-versions.sh):
- Supports CLI flags or interactive prompts
- --dry-run for preview, --no-install to skip flutter pub get,
  --yes for non-interactive use, --force to bypass dirty-tree guard
- Preserves the existing constraint operator (^/~/exact) on the
  hms_room_kit hmssdk_flutter dep when bumping
- Maintains the lockstep invariant between sdk-versions.json.flutter
  and hmssdk_flutter's pubspec version (the iOS Podspec uses the
  former as s.version)
- Reuses the existing scripts/update-changelog-versions.js for the
  ExampleAppChangelog.txt version block
- Never commits or pushes — leaves final review to the user

Workflow (.github/workflows/bump-sdk-versions.yml):
- workflow_dispatch only; ubuntu-latest runner
- Runs the script with --no-install, then runs flutter pub get in 4
  dirs in parallel so pubspec.lock files are refreshed
- Opens a PR against the default branch via
  peter-evans/create-pull-request@v6

Also adds an "update-sdk-versions" entry to scripts/package.json so
the script can be invoked as `npm --prefix scripts run update-sdk-versions`.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Generated by:
  bash scripts/update-sdk-versions.sh \
    --ios-sdk 1.17.2 --android-sdk 2.9.84 \
    --hmssdk-bump patch --room-kit-bump patch \
    --no-install --yes

Demonstrates the script's six-file change set on a real bump:
- sdk-versions.json: ios 1.17.0->1.17.2, android 2.9.83->2.9.84,
  flutter 1.11.1->1.11.2 (lockstep with hmssdk_flutter)
- hmssdk_flutter pubspec + example pubspec: 1.11.1 -> 1.11.2
- hms_room_kit pubspec: version 1.2.1->1.2.2 + hmssdk_flutter
  dep auto-synced 1.11.1->1.11.2
- hms_room_kit example pubspec: 1.2.0 -> 1.2.2 (drift correction:
  was lagging at 1.2.0 vs package's 1.2.1, plus the new patch bump)
- ExampleAppChangelog.txt 'Current Version Info' block refreshed
  by scripts/update-changelog-versions.js

NOTE: --no-install used because hmssdk_flutter@1.11.2 doesn't
exist on pub.dev yet. In a real release, the engineer publishes
hmssdk_flutter to pub first, then 'flutter pub get' resolves
hms_room_kit's dep cleanly. A 'dependency_overrides' block
pointing hmssdk_flutter at the local path would also work for
in-repo development without publish.

This commit can be reverted before merging the PR if you want
the PR to remain purely scaffolding.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Adds the project-level Claude skill at .claude/skills/update-sdk-versions.md
so any team member running Claude Code on this repo gets the SDK-bump
workflow as a discoverable skill (triggers on phrases like "update SDK
versions", "bump HMSSDK", etc.).

Updates .gitignore to:
- Re-include .claude/ (overrides any global '.claude' ignore rule that
  individual contributors may have in ~/.gitignore_global)
- Still exclude .claude/settings.local.json (per-machine permission rules
  and hooks; the .local. suffix is Claude Code's convention for personal
  config that should not be committed)
- Still exclude .claude/.cache/ (Claude Code's local cache directory)

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@ygit ygit requested a review from sapta100ms April 30, 2026 08:12
@ygit ygit changed the base branch from main to develop April 30, 2026 08:13
ygit and others added 4 commits April 30, 2026 13:54
After source-file writes, the script now runs 'pod install --repo-update'
when any iOS native field changed, and './gradlew :app:dependencies
--refresh-dependencies' when --android-sdk changed. If either fails the
script aborts with a clear hint to 'git checkout .' to revert.

Catches the case the user surfaced during the demo: writing a typo'd
version (e.g. 1.17.2 when the latest published is 1.17.1) used to write
to disk silently and only blow up at next build time. Now it fails
the bump itself.

Skipped by --no-install (existing flag, scope expanded to skip native
validation alongside Dart pub get).

Successful pod install also refreshes Podfile.lock / Pods/, which lands
in the change set as a side effect.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Replaces the original pod-install-as-validator approach (which
silently passed wrong versions due to Podfile.lock reuse with
path-based plugins) with an HTTPS HEAD check against the CocoaPods
CDN / Maven Central. This is the source of truth for "does this
version exist".

Verified by negative test:
  bash scripts/update-sdk-versions.sh --ios-sdk 1.99.99 --yes
  → ✗ HMSSDK 1.99.99 — not found on CocoaPods CDN
  → exit 1

And positive test:
  bash scripts/update-sdk-versions.sh --ios-sdk 1.17.1 --yes
  → ✓ HMSSDK 1.17.1
  → continues, refreshes Podfile.lock, exit 0

pod install --repo-update and gradle deps refresh still run after
HTTP validation passes, since they update OTHER lock entries
(Firebase, safe_device, transitive deps) — they're a side-effect
refresh, not a primary validator.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Replaces the previously reverted demo (d9cd2e1) with output from
the script run against the actual latest published native SDK
versions:

  bash scripts/update-sdk-versions.sh \
    --ios-sdk 1.17.1 \
    --hmssdk-bump skip --room-kit-bump skip \
    --yes

Changes:
- sdk-versions.json: ios 1.17.0 -> 1.17.1 (latest on CocoaPods,
  released 2025-11-17). Android stays at 2.9.83 (current latest,
  released 2026-04-10).
- hms_room_kit/example/pubspec.yaml: 1.2.0 -> 1.2.1
  (drift auto-correction; the example was lagging the package's
  1.2.1 — the script catches this drift even with --room-kit-bump=skip)
- ExampleAppChangelog.txt: 'Current Version Info' block refreshed
  to match the new state.

The script's HTTP HEAD validation against the CocoaPods CDN
confirmed HMSSDK 1.17.1 exists before writing.

NOTE: pubspec.lock and Podfile.lock changes are NOT committed in
this demo. In this monorepo, hms_room_kit's example pulls
hmssdk_flutter from pub.dev (not via path:), so pod install
reads the published plugin's frozen sdk-versions.json — meaning
local edits to packages/hmssdk_flutter/lib/assets/sdk-versions.json
don't propagate to Podfile.lock until the plugin is republished
to pub.dev with the new values. The script handles this correctly:
HTTP HEAD validates the registry; pod install runs as a side-effect
refresh for OTHER lock entries.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants