chore: add SDK version updater script and bump workflow#1853
Open
ygit wants to merge 8 commits into
Open
Conversation
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>
This reverts commit d9cd2e1.
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
scripts/update-sdk-versions.sh: a bash one-shot to bump native SDK versions insdk-versions.jsonand Flutter package versions in lock-step acrosshmssdk_flutter,hms_room_kit, and their example apps..github/workflows/bump-sdk-versions.yml: aworkflow_dispatchGitHub Action that exposes the script with form inputs and opens a PR viapeter-evans/create-pull-request@v6.update-sdk-versionsentry toscripts/package.jsonso the script can be invoked asnpm --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
packages/hmssdk_flutter/lib/assets/sdk-versions.json(the Podspec and Androidbuild.gradleread this programmatically — they're not edited).packages/hmssdk_flutter/pubspec.yaml+ its example.packages/hms_room_kit/pubspec.yaml+ its example.hms_room_kit'shmssdk_flutter:dependency to the resolved hmssdk_flutter version (auto-corrects drift; preserves^/~/exact operator).sdk-versions.json.flutterand the hmssdk_flutter pubspec version.flutter pub getin 4 dirs in parallel to refreshpubspec.lockfiles.scripts/update-changelog-versions.jsto refresh the version block at the bottom ofExampleAppChangelog.txt.pod installreminder 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
--ios-sdk,--android-sdk,--ios-broadcast,--ios-hls,--ios-noise-cancelsdk-versions.json--hmssdk-bump,--room-kit-bumpskip|patch|minor|majorpackage bumps--dry-run--no-installflutter pub get--yes,--force,--helpTest plan
bash scripts/update-sdk-versions.sh --helprenders correctly--ios-sdk foo) and invalid bump kind (--hmssdk-bump bogus) rejected before any write--dry-runfull bump prints preview, makes zero file changeshms_room_kit/examplewas at 1.2.0 while package was at 1.2.1) auto-corrects without touching unchanged filessdk-versions.json.flutteralways matches the hmssdk_flutter pubspec version after a runworkflow_dispatchwith patch bumps)Notes for reviewers
release-apps.shGitHub Action workflow (with macOS runner, code signing, secrets setup doc) is intentionally deferred to a separate PR. Notes for that work are kept locally..claude/skills/update-sdk-versions.mdClaude 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