sdk-release-kit 0.2.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- sdk_release_kit/__init__.py +3 -0
- sdk_release_kit/_data/examples/custom.example.yaml +18 -0
- sdk_release_kit/_data/examples/keys.example.yaml +18 -0
- sdk_release_kit/_data/examples/outputs.example.yaml +19 -0
- sdk_release_kit/_data/examples/repos.example.yaml +33 -0
- sdk_release_kit/_data/recipes/sdks.yaml +222 -0
- sdk_release_kit/_data/web/app.js +305 -0
- sdk_release_kit/_data/web/index.html +142 -0
- sdk_release_kit/_data/web/styles.css +93 -0
- sdk_release_kit/builders/__init__.py +24 -0
- sdk_release_kit/builders/android.py +86 -0
- sdk_release_kit/builders/base.py +217 -0
- sdk_release_kit/builders/flutter.py +16 -0
- sdk_release_kit/builders/generic.py +56 -0
- sdk_release_kit/builders/ios.py +204 -0
- sdk_release_kit/builders/reactnative.py +32 -0
- sdk_release_kit/cli.py +198 -0
- sdk_release_kit/mcp_server.py +240 -0
- sdk_release_kit/models.py +306 -0
- sdk_release_kit/paths.py +85 -0
- sdk_release_kit/pipeline.py +446 -0
- sdk_release_kit/recipes.py +110 -0
- sdk_release_kit/runlog.py +62 -0
- sdk_release_kit/server.py +331 -0
- sdk_release_kit/store/__init__.py +29 -0
- sdk_release_kit/store/_yaml.py +46 -0
- sdk_release_kit/store/custom.py +34 -0
- sdk_release_kit/store/keys.py +111 -0
- sdk_release_kit/store/outputs.py +15 -0
- sdk_release_kit/store/repos.py +15 -0
- sdk_release_kit/uploaders/__init__.py +20 -0
- sdk_release_kit/uploaders/onedrive.py +129 -0
- sdk_release_kit/uploaders/play.py +108 -0
- sdk_release_kit/uploaders/testflight.py +105 -0
- sdk_release_kit-0.2.0.dist-info/METADATA +307 -0
- sdk_release_kit-0.2.0.dist-info/RECORD +39 -0
- sdk_release_kit-0.2.0.dist-info/WHEEL +4 -0
- sdk_release_kit-0.2.0.dist-info/entry_points.txt +2 -0
- sdk_release_kit-0.2.0.dist-info/licenses/LICENSE +21 -0
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
"""OneDrive or any shared folder, treated as a locally synced directory: we copy files in.
|
|
2
|
+
|
|
3
|
+
Demos go to ``<root>/<folder>/<name>`` from the recipe's ``onedrive_targets``.
|
|
4
|
+
Packages go to ``<root>/<packages>/<recipe-id>/<version>/`` with ``<recipe-id>/LATEST.txt``.
|
|
5
|
+
Files are written under a temporary name and renamed, so sync clients never pick up a
|
|
6
|
+
half-copied file.
|
|
7
|
+
"""
|
|
8
|
+
|
|
9
|
+
from __future__ import annotations
|
|
10
|
+
|
|
11
|
+
import os
|
|
12
|
+
import shutil
|
|
13
|
+
import time
|
|
14
|
+
from pathlib import Path
|
|
15
|
+
|
|
16
|
+
from ..builders import Artifact
|
|
17
|
+
from ..models import OutputsSettings, RecipesFile
|
|
18
|
+
from ..paths import expand
|
|
19
|
+
from ..runlog import RunLog
|
|
20
|
+
from . import UploadResult
|
|
21
|
+
|
|
22
|
+
DEMO_FOLDER_BY_KIND = {
|
|
23
|
+
"apk": "demos_android",
|
|
24
|
+
"aab": "demos_android",
|
|
25
|
+
"ipa": "demos_ios",
|
|
26
|
+
"app": "demos_ios",
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
def readiness(outputs: OutputsSettings) -> str | None:
|
|
31
|
+
od = outputs.onedrive
|
|
32
|
+
if not od.enabled:
|
|
33
|
+
return "disabled in Outputs"
|
|
34
|
+
root = expand(od.root)
|
|
35
|
+
if root is None:
|
|
36
|
+
return "no shared folder root set in Outputs"
|
|
37
|
+
if not root.is_dir():
|
|
38
|
+
return f"shared folder root does not exist: {root}"
|
|
39
|
+
return None
|
|
40
|
+
|
|
41
|
+
|
|
42
|
+
def _subfolder(outputs: OutputsSettings, key: str) -> str:
|
|
43
|
+
value = getattr(outputs.onedrive, key, None)
|
|
44
|
+
if value is None:
|
|
45
|
+
extra = outputs.onedrive.model_extra or {}
|
|
46
|
+
value = extra.get(key, key)
|
|
47
|
+
return str(value)
|
|
48
|
+
|
|
49
|
+
|
|
50
|
+
def _place(src: Path, dest: Path) -> None:
|
|
51
|
+
dest.parent.mkdir(parents=True, exist_ok=True)
|
|
52
|
+
tmp = dest.with_name(f".{dest.name}.partial")
|
|
53
|
+
if tmp.exists():
|
|
54
|
+
shutil.rmtree(tmp) if tmp.is_dir() else tmp.unlink()
|
|
55
|
+
if src.is_dir():
|
|
56
|
+
shutil.copytree(src, tmp, symlinks=True)
|
|
57
|
+
if dest.exists():
|
|
58
|
+
shutil.rmtree(dest) if dest.is_dir() else dest.unlink()
|
|
59
|
+
os.replace(tmp, dest)
|
|
60
|
+
else:
|
|
61
|
+
shutil.copy2(src, tmp)
|
|
62
|
+
if dest.is_dir():
|
|
63
|
+
shutil.rmtree(dest)
|
|
64
|
+
os.replace(tmp, dest)
|
|
65
|
+
|
|
66
|
+
|
|
67
|
+
def publish(
|
|
68
|
+
artifacts: list[Artifact],
|
|
69
|
+
recipes: RecipesFile,
|
|
70
|
+
outputs: OutputsSettings,
|
|
71
|
+
log: RunLog,
|
|
72
|
+
meta: dict[str, str],
|
|
73
|
+
) -> list[UploadResult]:
|
|
74
|
+
root = expand(outputs.onedrive.root)
|
|
75
|
+
assert root is not None
|
|
76
|
+
results: list[UploadResult] = []
|
|
77
|
+
|
|
78
|
+
for art in (a for a in artifacts if a.stage == "demos"):
|
|
79
|
+
if art.target:
|
|
80
|
+
target = recipes.onedrive_targets[art.target]
|
|
81
|
+
dest = root / _subfolder(outputs, target.folder) / target.name
|
|
82
|
+
elif outputs.onedrive.copy_untargeted and art.kind in DEMO_FOLDER_BY_KIND:
|
|
83
|
+
folder = _subfolder(outputs, DEMO_FOLDER_BY_KIND[art.kind])
|
|
84
|
+
dest = root / folder / art.recipe / art.path.name
|
|
85
|
+
else:
|
|
86
|
+
continue
|
|
87
|
+
try:
|
|
88
|
+
_place(art.path, dest)
|
|
89
|
+
log.info(f"onedrive: {art.path.name} -> {dest.relative_to(root)}")
|
|
90
|
+
results.append(UploadResult("onedrive", art.path.name, "ok", location=str(dest)))
|
|
91
|
+
except OSError as exc:
|
|
92
|
+
results.append(UploadResult("onedrive", art.path.name, "failed", str(exc)))
|
|
93
|
+
|
|
94
|
+
packages = [a for a in artifacts if a.stage == "packages"]
|
|
95
|
+
for recipe_id in sorted({a.recipe for a in packages}):
|
|
96
|
+
items = [a for a in packages if a.recipe == recipe_id]
|
|
97
|
+
version = items[0].version
|
|
98
|
+
recipe_dir = root / _subfolder(outputs, "packages") / recipe_id
|
|
99
|
+
version_dir = recipe_dir / version
|
|
100
|
+
placed = []
|
|
101
|
+
for art in items:
|
|
102
|
+
try:
|
|
103
|
+
_place(art.path, version_dir / art.path.name)
|
|
104
|
+
placed.append(art.path.name)
|
|
105
|
+
results.append(
|
|
106
|
+
UploadResult("onedrive", art.path.name, "ok", location=str(version_dir))
|
|
107
|
+
)
|
|
108
|
+
except OSError as exc:
|
|
109
|
+
results.append(UploadResult("onedrive", art.path.name, "failed", str(exc)))
|
|
110
|
+
if placed:
|
|
111
|
+
latest = "\n".join(
|
|
112
|
+
[
|
|
113
|
+
f"recipe: {recipe_id}",
|
|
114
|
+
f"version: {version}",
|
|
115
|
+
f"built_at: {time.strftime('%Y-%m-%dT%H:%M:%S%z')}",
|
|
116
|
+
f"commit: {meta.get(recipe_id + '.commit', 'unknown')}",
|
|
117
|
+
f"path: {version}/",
|
|
118
|
+
"files:",
|
|
119
|
+
*[f" - {name}" for name in placed],
|
|
120
|
+
"",
|
|
121
|
+
]
|
|
122
|
+
)
|
|
123
|
+
tmp = recipe_dir / ".LATEST.txt.partial"
|
|
124
|
+
tmp.write_text(latest, encoding="utf-8")
|
|
125
|
+
os.replace(tmp, recipe_dir / "LATEST.txt")
|
|
126
|
+
log.info(
|
|
127
|
+
f"onedrive: packages for {recipe_id} {version} -> {version_dir.relative_to(root)}"
|
|
128
|
+
)
|
|
129
|
+
return results
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
"""Google Play internal testing upload for AABs.
|
|
2
|
+
|
|
3
|
+
Method ``api`` uses the Google Play Developer API (``pip install 'sdk-release-kit[play]'``).
|
|
4
|
+
Method ``fastlane`` shells out to ``fastlane supply``. ``auto`` prefers the API library and
|
|
5
|
+
falls back to fastlane. Missing credentials or tools mean a soft skip, never a failed run.
|
|
6
|
+
"""
|
|
7
|
+
|
|
8
|
+
from __future__ import annotations
|
|
9
|
+
|
|
10
|
+
import importlib.util
|
|
11
|
+
import shutil
|
|
12
|
+
import subprocess
|
|
13
|
+
from pathlib import Path
|
|
14
|
+
|
|
15
|
+
from ..models import KeysSettings, OutputsSettings
|
|
16
|
+
from ..paths import expand
|
|
17
|
+
from ..runlog import RunLog
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
def _method(outputs: OutputsSettings) -> str | None:
|
|
21
|
+
wanted = outputs.play.method
|
|
22
|
+
has_api = importlib.util.find_spec("googleapiclient") is not None
|
|
23
|
+
has_fastlane = shutil.which("fastlane") is not None
|
|
24
|
+
if wanted in ("auto", "api") and has_api:
|
|
25
|
+
return "api"
|
|
26
|
+
if wanted in ("auto", "fastlane") and has_fastlane:
|
|
27
|
+
return "fastlane"
|
|
28
|
+
return None
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
def readiness(outputs: OutputsSettings, keys: KeysSettings) -> str | None:
|
|
32
|
+
if not outputs.play.enabled:
|
|
33
|
+
return "disabled in Outputs"
|
|
34
|
+
key = expand(keys.play.json_key_path)
|
|
35
|
+
if key is None:
|
|
36
|
+
return "no Play service account JSON set in Keys"
|
|
37
|
+
if not key.is_file():
|
|
38
|
+
return f"Play service account JSON not found: {key}"
|
|
39
|
+
if _method(outputs) is None:
|
|
40
|
+
return (
|
|
41
|
+
"no upload method: install the API extra (pip install 'sdk-release-kit[play]') "
|
|
42
|
+
"or fastlane"
|
|
43
|
+
)
|
|
44
|
+
return None
|
|
45
|
+
|
|
46
|
+
|
|
47
|
+
def upload(
|
|
48
|
+
aab: Path, package: str, outputs: OutputsSettings, keys: KeysSettings, log: RunLog
|
|
49
|
+
) -> str:
|
|
50
|
+
"""Upload one AAB; return a short description. Raises on failure."""
|
|
51
|
+
key = expand(keys.play.json_key_path)
|
|
52
|
+
assert key is not None
|
|
53
|
+
track = outputs.play.track
|
|
54
|
+
status = outputs.play.release_status
|
|
55
|
+
method = _method(outputs)
|
|
56
|
+
if method == "api":
|
|
57
|
+
from google.oauth2 import service_account
|
|
58
|
+
from googleapiclient.discovery import build
|
|
59
|
+
from googleapiclient.http import MediaFileUpload
|
|
60
|
+
|
|
61
|
+
creds = service_account.Credentials.from_service_account_file(
|
|
62
|
+
str(key), scopes=["https://www.googleapis.com/auth/androidpublisher"]
|
|
63
|
+
)
|
|
64
|
+
svc = build("androidpublisher", "v3", credentials=creds, cache_discovery=False)
|
|
65
|
+
edits = svc.edits()
|
|
66
|
+
edit_id = edits.insert(packageName=package, body={}).execute()["id"]
|
|
67
|
+
media = MediaFileUpload(str(aab), mimetype="application/octet-stream", resumable=True)
|
|
68
|
+
bundle = (
|
|
69
|
+
edits.bundles().upload(packageName=package, editId=edit_id, media_body=media).execute()
|
|
70
|
+
)
|
|
71
|
+
code = str(bundle["versionCode"])
|
|
72
|
+
edits.tracks().update(
|
|
73
|
+
packageName=package,
|
|
74
|
+
editId=edit_id,
|
|
75
|
+
track=track,
|
|
76
|
+
body={"track": track, "releases": [{"versionCodes": [code], "status": status}]},
|
|
77
|
+
).execute()
|
|
78
|
+
edits.commit(packageName=package, editId=edit_id).execute()
|
|
79
|
+
return f"{package} versionCode {code} on {track} ({status})"
|
|
80
|
+
|
|
81
|
+
argv = [
|
|
82
|
+
"fastlane",
|
|
83
|
+
"supply",
|
|
84
|
+
"--aab",
|
|
85
|
+
str(aab),
|
|
86
|
+
"--package_name",
|
|
87
|
+
package,
|
|
88
|
+
"--track",
|
|
89
|
+
track,
|
|
90
|
+
"--release_status",
|
|
91
|
+
status,
|
|
92
|
+
"--json_key",
|
|
93
|
+
str(key),
|
|
94
|
+
"--skip_upload_metadata",
|
|
95
|
+
"true",
|
|
96
|
+
"--skip_upload_images",
|
|
97
|
+
"true",
|
|
98
|
+
"--skip_upload_screenshots",
|
|
99
|
+
"true",
|
|
100
|
+
"--skip_upload_changelogs",
|
|
101
|
+
"true",
|
|
102
|
+
]
|
|
103
|
+
proc = subprocess.run(argv, capture_output=True, text=True)
|
|
104
|
+
for line in (proc.stdout + proc.stderr).splitlines():
|
|
105
|
+
log.line(f" {line}")
|
|
106
|
+
if proc.returncode != 0:
|
|
107
|
+
raise RuntimeError(f"fastlane supply exited with {proc.returncode}")
|
|
108
|
+
return f"{package} on {track} ({status}) via fastlane"
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
"""TestFlight upload for IPAs with an App Store Connect API key (key id, issuer id, .p8).
|
|
2
|
+
|
|
3
|
+
``altool`` (default) ships with Xcode. ``fastlane`` uses ``fastlane pilot``. The key file is
|
|
4
|
+
staged into a private temporary directory under the name the tools expect, then removed.
|
|
5
|
+
"""
|
|
6
|
+
|
|
7
|
+
from __future__ import annotations
|
|
8
|
+
|
|
9
|
+
import json
|
|
10
|
+
import os
|
|
11
|
+
import shutil
|
|
12
|
+
import subprocess
|
|
13
|
+
import sys
|
|
14
|
+
import tempfile
|
|
15
|
+
from pathlib import Path
|
|
16
|
+
|
|
17
|
+
from ..models import KeysSettings, OutputsSettings
|
|
18
|
+
from ..paths import expand
|
|
19
|
+
from ..runlog import RunLog
|
|
20
|
+
from ..store.keys import resolve_secret
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
def readiness(outputs: OutputsSettings, keys: KeysSettings) -> str | None:
|
|
24
|
+
if not outputs.testflight.enabled:
|
|
25
|
+
return "disabled in Outputs"
|
|
26
|
+
tf = keys.testflight
|
|
27
|
+
if not resolve_secret(tf.key_id):
|
|
28
|
+
return f"App Store Connect key id not available ({tf.key_id.source}:{tf.key_id.name})"
|
|
29
|
+
if not resolve_secret(tf.issuer_id):
|
|
30
|
+
return (
|
|
31
|
+
f"App Store Connect issuer id not available ({tf.issuer_id.source}:{tf.issuer_id.name})"
|
|
32
|
+
)
|
|
33
|
+
key = expand(tf.key_path)
|
|
34
|
+
if key is None or not key.is_file():
|
|
35
|
+
return "App Store Connect .p8 key file not set or missing in Keys"
|
|
36
|
+
if outputs.testflight.method == "altool" and (
|
|
37
|
+
sys.platform != "darwin" or not shutil.which("xcrun")
|
|
38
|
+
):
|
|
39
|
+
return "altool needs macOS with Xcode"
|
|
40
|
+
if outputs.testflight.method == "fastlane" and not shutil.which("fastlane"):
|
|
41
|
+
return "fastlane not installed"
|
|
42
|
+
return None
|
|
43
|
+
|
|
44
|
+
|
|
45
|
+
def _run(argv: list[str], env: dict[str, str], log: RunLog) -> None:
|
|
46
|
+
proc = subprocess.run(argv, capture_output=True, text=True, env=env)
|
|
47
|
+
for line in (proc.stdout + proc.stderr).splitlines():
|
|
48
|
+
log.line(f" {line}")
|
|
49
|
+
if proc.returncode != 0:
|
|
50
|
+
raise RuntimeError(f"{argv[0]} {argv[1]} exited with {proc.returncode}")
|
|
51
|
+
|
|
52
|
+
|
|
53
|
+
def upload(ipa: Path, outputs: OutputsSettings, keys: KeysSettings, log: RunLog) -> str:
|
|
54
|
+
tf = keys.testflight
|
|
55
|
+
key_id = resolve_secret(tf.key_id) or ""
|
|
56
|
+
issuer = resolve_secret(tf.issuer_id) or ""
|
|
57
|
+
key_path = expand(tf.key_path)
|
|
58
|
+
assert key_path is not None
|
|
59
|
+
with tempfile.TemporaryDirectory(prefix="srk-asc-") as tmp:
|
|
60
|
+
os.chmod(tmp, 0o700)
|
|
61
|
+
env = dict(os.environ)
|
|
62
|
+
if outputs.testflight.method == "fastlane":
|
|
63
|
+
api_json = Path(tmp) / "asc.json"
|
|
64
|
+
content = key_path.read_text(encoding="utf-8")
|
|
65
|
+
log.add_secret(content)
|
|
66
|
+
api_json.write_text(json.dumps({"key_id": key_id, "issuer_id": issuer, "key": content}))
|
|
67
|
+
os.chmod(api_json, 0o600)
|
|
68
|
+
_run(
|
|
69
|
+
[
|
|
70
|
+
"fastlane",
|
|
71
|
+
"pilot",
|
|
72
|
+
"upload",
|
|
73
|
+
"--ipa",
|
|
74
|
+
str(ipa),
|
|
75
|
+
"--api_key_path",
|
|
76
|
+
str(api_json),
|
|
77
|
+
"--skip_waiting_for_build_processing",
|
|
78
|
+
"true",
|
|
79
|
+
],
|
|
80
|
+
env,
|
|
81
|
+
log,
|
|
82
|
+
)
|
|
83
|
+
return f"{ipa.name} uploaded via fastlane pilot"
|
|
84
|
+
staged = Path(tmp) / f"AuthKey_{key_id}.p8"
|
|
85
|
+
shutil.copy2(key_path, staged)
|
|
86
|
+
os.chmod(staged, 0o600)
|
|
87
|
+
env["API_PRIVATE_KEYS_DIR"] = tmp
|
|
88
|
+
_run(
|
|
89
|
+
[
|
|
90
|
+
"xcrun",
|
|
91
|
+
"altool",
|
|
92
|
+
"--upload-app",
|
|
93
|
+
"-f",
|
|
94
|
+
str(ipa),
|
|
95
|
+
"-t",
|
|
96
|
+
"ios",
|
|
97
|
+
"--apiKey",
|
|
98
|
+
key_id,
|
|
99
|
+
"--apiIssuer",
|
|
100
|
+
issuer,
|
|
101
|
+
],
|
|
102
|
+
env,
|
|
103
|
+
log,
|
|
104
|
+
)
|
|
105
|
+
return f"{ipa.name} uploaded via altool"
|
|
@@ -0,0 +1,307 @@
|
|
|
1
|
+
Metadata-Version: 2.5
|
|
2
|
+
Name: sdk-release-kit
|
|
3
|
+
Version: 0.2.0
|
|
4
|
+
Summary: Build mobile SDK demo apps and packages, then publish them to a shared folder, Google Play internal testing and TestFlight.
|
|
5
|
+
Project-URL: Homepage, https://github.com/yehyatt/sdk-release-kit
|
|
6
|
+
Project-URL: Repository, https://github.com/yehyatt/sdk-release-kit
|
|
7
|
+
Project-URL: Issues, https://github.com/yehyatt/sdk-release-kit/issues
|
|
8
|
+
Author: Yahya
|
|
9
|
+
License-Expression: MIT
|
|
10
|
+
License-File: LICENSE
|
|
11
|
+
Keywords: ai-agents,android,flutter,google-play,ios,mcp,mcp-server,react-native,release,sdk,testflight
|
|
12
|
+
Classifier: Operating System :: MacOS
|
|
13
|
+
Classifier: Programming Language :: Python :: 3
|
|
14
|
+
Classifier: Topic :: Software Development :: Build Tools
|
|
15
|
+
Requires-Python: >=3.11
|
|
16
|
+
Requires-Dist: fastapi>=0.110
|
|
17
|
+
Requires-Dist: keyring>=24
|
|
18
|
+
Requires-Dist: mcp<3,>=2.3
|
|
19
|
+
Requires-Dist: pydantic>=2.6
|
|
20
|
+
Requires-Dist: pyyaml>=6.0
|
|
21
|
+
Requires-Dist: typer>=0.12
|
|
22
|
+
Requires-Dist: uvicorn>=0.29
|
|
23
|
+
Provides-Extra: dev
|
|
24
|
+
Requires-Dist: pytest>=8; extra == 'dev'
|
|
25
|
+
Requires-Dist: ruff>=0.4; extra == 'dev'
|
|
26
|
+
Provides-Extra: play
|
|
27
|
+
Requires-Dist: google-api-python-client>=2.100; extra == 'play'
|
|
28
|
+
Requires-Dist: google-auth>=2.25; extra == 'play'
|
|
29
|
+
Description-Content-Type: text/markdown
|
|
30
|
+
|
|
31
|
+
# SDK Release Kit
|
|
32
|
+
|
|
33
|
+
Build mobile SDK demo apps and SDK packages from one or more local checkouts, then publish
|
|
34
|
+
them to a shared folder (OneDrive or any synced folder), Google Play internal testing and
|
|
35
|
+
TestFlight. Configure it once per machine through a local Settings UI; the same repository
|
|
36
|
+
works on every developer's Mac without editing scripts.
|
|
37
|
+
|
|
38
|
+
Supports Android (Gradle), iOS (Xcode), Flutter and React Native SDKs out of the box. New
|
|
39
|
+
SDKs are added in a YAML recipe file, usually without code changes.
|
|
40
|
+
|
|
41
|
+
AI agents can drive it too: it ships an [MCP server](#use-with-ai-agents) and a Claude Code
|
|
42
|
+
plugin.
|
|
43
|
+
|
|
44
|
+
<!-- mcp-name: io.github.yehyatt/sdk-release-kit -->
|
|
45
|
+
|
|
46
|
+
## Install
|
|
47
|
+
|
|
48
|
+
Python 3.11 or newer.
|
|
49
|
+
|
|
50
|
+
```bash
|
|
51
|
+
pip install sdk-release-kit # or run without installing: uvx sdk-release-kit --help
|
|
52
|
+
sdk-release-kit init
|
|
53
|
+
sdk-release-kit serve
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
From source:
|
|
57
|
+
|
|
58
|
+
```bash
|
|
59
|
+
git clone https://github.com/yehyatt/sdk-release-kit.git
|
|
60
|
+
cd sdk-release-kit
|
|
61
|
+
python3 -m venv .venv && source .venv/bin/activate
|
|
62
|
+
pip install -e . # add '.[play]' for direct Google Play API uploads
|
|
63
|
+
sdk-release-kit init # creates your settings from examples/
|
|
64
|
+
sdk-release-kit serve # opens the Settings UI on http://127.0.0.1:8765
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
Fill in **Repositories**, **Outputs** and **Keys** in the UI, then:
|
|
68
|
+
|
|
69
|
+
```bash
|
|
70
|
+
sdk-release-kit build --sdks flutter,android-current --artifacts both --dest onedrive
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
## Use with AI agents
|
|
74
|
+
|
|
75
|
+
`sdk-release-kit mcp` runs an MCP server on stdio. Its tools:
|
|
76
|
+
|
|
77
|
+
| Tool | Does |
|
|
78
|
+
| --- | --- |
|
|
79
|
+
| `get_status` | Checkouts, key status (configured or missing, never values), destination readiness, tools on PATH |
|
|
80
|
+
| `list_recipes` | Recipe ids, steps, store flags and checkout per recipe |
|
|
81
|
+
| `plan_build` | Dry run: exact commands, collected files, ready or skipped destinations |
|
|
82
|
+
| `run_build` | Build and publish; returns the run report and the end of the log |
|
|
83
|
+
| `list_runs`, `get_run_report` | Previous runs and their reports |
|
|
84
|
+
| `set_repo_path` | Point a recipe at a local checkout |
|
|
85
|
+
|
|
86
|
+
**Claude Code plugin** (MCP server plus a `release-sdks` skill):
|
|
87
|
+
|
|
88
|
+
```
|
|
89
|
+
/plugin install sdk-release-kit --marketplace yehyatt/sdk-release-kit
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
On older Claude Code versions: `/plugin marketplace add yehyatt/sdk-release-kit`, then
|
|
93
|
+
`/plugin install sdk-release-kit@sdk-release-kit`.
|
|
94
|
+
|
|
95
|
+
**Claude Code, MCP only:**
|
|
96
|
+
|
|
97
|
+
```bash
|
|
98
|
+
claude mcp add sdk-release-kit -- uvx sdk-release-kit mcp
|
|
99
|
+
```
|
|
100
|
+
|
|
101
|
+
**Claude Desktop, Cursor, Windsurf, VS Code and other MCP clients:**
|
|
102
|
+
|
|
103
|
+
```json
|
|
104
|
+
{
|
|
105
|
+
"mcpServers": {
|
|
106
|
+
"sdk-release-kit": { "command": "uvx", "args": ["sdk-release-kit", "mcp"] }
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
```
|
|
110
|
+
|
|
111
|
+
The server never returns secret values, and keys are still entered through the Settings UI.
|
|
112
|
+
Agents are told to plan before building and to confirm before uploading to Play or TestFlight.
|
|
113
|
+
Listed in the [MCP Registry](https://registry.modelcontextprotocol.io) as
|
|
114
|
+
`io.github.yehyatt/sdk-release-kit`. A summary for language models is in
|
|
115
|
+
[llms.txt](https://github.com/yehyatt/sdk-release-kit/blob/main/llms.txt).
|
|
116
|
+
|
|
117
|
+
## Commands
|
|
118
|
+
|
|
119
|
+
| Command | What it does |
|
|
120
|
+
| --- | --- |
|
|
121
|
+
| `sdk-release-kit init [--force]` | Copy `examples/*.example.yaml` into your settings directory |
|
|
122
|
+
| `sdk-release-kit serve` | Settings UI (Repositories, Outputs, Keys, Custom data, Run) |
|
|
123
|
+
| `sdk-release-kit build ...` | Build and publish (see options below) |
|
|
124
|
+
| `sdk-release-kit build --dry-run` | Print the plan: commands, collected files, destinations |
|
|
125
|
+
| `sdk-release-kit recipes` | List recipe ids and where they were loaded from |
|
|
126
|
+
| `sdk-release-kit status` | Settings files, key status (never values), installed tools |
|
|
127
|
+
| `sdk-release-kit keys set <name>` | Store a secret in the OS keychain (prompted, not echoed) |
|
|
128
|
+
| `sdk-release-kit mcp` | MCP server on stdio for AI agents |
|
|
129
|
+
|
|
130
|
+
`build` options:
|
|
131
|
+
|
|
132
|
+
* `--sdks android-current,flutter`: recipe ids. Default: every enabled repository.
|
|
133
|
+
* `--artifacts demos|packages|both`
|
|
134
|
+
* `--dest onedrive,play,testflight`: default is every destination enabled in Outputs.
|
|
135
|
+
* `--dry-run`: plan only. `--skip-upload`: build only. `--json`: print the report.
|
|
136
|
+
|
|
137
|
+
## How configuration is split
|
|
138
|
+
|
|
139
|
+
| Layer | Where | In git? | Holds |
|
|
140
|
+
| --- | --- | --- | --- |
|
|
141
|
+
| Recipes | `recipes/sdks.yaml` | Yes | Relative paths inside a repo, Gradle tasks, Xcode schemes, shared-folder target ids, store flags |
|
|
142
|
+
| Repos | `<settings>/repos.yaml` | No | Recipe id to absolute checkout path; JDK, Android SDK, Flutter, Xcode locations |
|
|
143
|
+
| Outputs | `<settings>/outputs.yaml` | No | Staging directory, shared folder root, Play and TestFlight options |
|
|
144
|
+
| Keys | `<settings>/keys.yaml` | No | Paths to key files and *references* to passwords (keychain or env) |
|
|
145
|
+
| Custom | `<settings>/custom.yaml` | No | Free-form YAML read by recipes as `${custom.key}` |
|
|
146
|
+
|
|
147
|
+
`<settings>` is `~/.config/sdk-release-kit/` (or `$XDG_CONFIG_HOME/sdk-release-kit`, or
|
|
148
|
+
`%APPDATA%\sdk-release-kit` on Windows). Overrides:
|
|
149
|
+
|
|
150
|
+
* `SDK_RELEASE_KIT_HOME`: use another settings directory
|
|
151
|
+
* `SDK_RELEASE_KIT_REPOS`, `SDK_RELEASE_KIT_OUTPUTS`, `SDK_RELEASE_KIT_KEYS`, `SDK_RELEASE_KIT_CUSTOM`: point one layer at a specific file
|
|
152
|
+
* `SDK_RELEASE_KIT_RECIPES`: an extra recipe file merged over the shipped one
|
|
153
|
+
|
|
154
|
+
Machine-specific recipe tweaks go in `<settings>/recipes.d/*.yaml`. They are deep-merged over
|
|
155
|
+
`recipes/sdks.yaml`, so you can change one scheme name without forking the file.
|
|
156
|
+
|
|
157
|
+
## Adapting it to your SDKs
|
|
158
|
+
|
|
159
|
+
The shipped recipes use placeholder names. Do these three things before your first release.
|
|
160
|
+
|
|
161
|
+
1. **Match the recipes to your repositories.** Open `recipes/sdks.yaml` and check, for every
|
|
162
|
+
recipe you use, the `workdir`, Xcode `workspace` and `scheme`, Gradle tasks, `framework_name`
|
|
163
|
+
and `collect` globs. Placeholders include `DemoApp`, `PaymentSDK`, `SimpleIntegration`,
|
|
164
|
+
`:app` and `example/`. If the change applies to everyone using the repo, edit the file and
|
|
165
|
+
commit it. If it only applies to your machine, put just the changed keys in
|
|
166
|
+
`<settings>/recipes.d/local.yaml`; it is deep-merged over the shipped file:
|
|
167
|
+
|
|
168
|
+
```yaml
|
|
169
|
+
recipes:
|
|
170
|
+
ios-current:
|
|
171
|
+
demos:
|
|
172
|
+
- type: xcode-simulator
|
|
173
|
+
workspace: Example/Example.xcworkspace
|
|
174
|
+
scheme: Example
|
|
175
|
+
target: ios-native-current
|
|
176
|
+
```
|
|
177
|
+
|
|
178
|
+
Lists such as `demos` are replaced as a whole, so repeat every step of a list you override.
|
|
179
|
+
Then run `sdk-release-kit build --dry-run --sdks <id>` and read the commands it prints.
|
|
180
|
+
|
|
181
|
+
2. **Put your real identifiers in Custom data, not in git.** The recipes read store ids and the
|
|
182
|
+
Apple team from `custom.yaml` (Custom data page), falling back to `com.example.*`:
|
|
183
|
+
|
|
184
|
+
```yaml
|
|
185
|
+
ios_team_id: "ABCDE12345"
|
|
186
|
+
app_ids:
|
|
187
|
+
android_native: com.yourcompany.sdk.demo
|
|
188
|
+
ios_native: com.yourcompany.sdk.demoapp
|
|
189
|
+
flutter_android: com.yourcompany.sdk.flutter.demoapp
|
|
190
|
+
flutter_ios: com.yourcompany.sdk.flutter.demoapp
|
|
191
|
+
rn_android: com.yourcompany.sdk.reactnative.demoapp
|
|
192
|
+
rn_ios: com.yourcompany.sdk.reactnative.demoapp
|
|
193
|
+
```
|
|
194
|
+
|
|
195
|
+
A recipe with an empty `android_package` is skipped for Play. A `com.example.*` id is not
|
|
196
|
+
skipped: the upload fails, because Play only accepts apps that exist in your Play Console.
|
|
197
|
+
|
|
198
|
+
3. **Prove each destination once.** Start with the shared folder only:
|
|
199
|
+
`sdk-release-kit build --sdks <id> --artifacts demos --dest onedrive`, and open the copied
|
|
200
|
+
APK or `.app`. Then fill in the Keys page (the Keys chips must all show "configured") and
|
|
201
|
+
run one upload per store with a single recipe:
|
|
202
|
+
`--dest play` with an Android recipe, `--dest testflight` with an iOS one. Check the build
|
|
203
|
+
appears on the internal track or in TestFlight before relying on combined runs. Each run's
|
|
204
|
+
`report.json` lists what was uploaded, skipped or failed and why.
|
|
205
|
+
|
|
206
|
+
## Multi-device setup
|
|
207
|
+
|
|
208
|
+
1. Clone the repository and `pip install -e .` on the new machine.
|
|
209
|
+
2. `sdk-release-kit init`, or copy your `<settings>` directory from another machine and fix
|
|
210
|
+
the absolute paths.
|
|
211
|
+
3. Open `sdk-release-kit serve` and check that every repository shows a green check and every
|
|
212
|
+
key shows "configured".
|
|
213
|
+
4. Run `sdk-release-kit build --dry-run` before the first real build.
|
|
214
|
+
|
|
215
|
+
## Destinations
|
|
216
|
+
|
|
217
|
+
| Artifact | Shared folder | Google Play | TestFlight |
|
|
218
|
+
| --- | --- | --- | --- |
|
|
219
|
+
| Demo apps (APK, AAB, IPA, simulator `.app`) | Yes | AAB, when the recipe sets `store.play` | IPA, when the recipe sets `store.testflight` |
|
|
220
|
+
| SDK packages (AAR zip, XCFramework zip, `npm pack` tarball, Flutter source zip) | Yes | No | No |
|
|
221
|
+
|
|
222
|
+
* **Shared folder.** Treated as a locally synced directory: files are copied in (written to a
|
|
223
|
+
temporary name, then renamed). Demos land at `<root>/<demos folder>/<target name>`, for
|
|
224
|
+
example `android/native-current.apk`. Packages land at
|
|
225
|
+
`<root>/packages/<recipe-id>/<version>/` with `<recipe-id>/LATEST.txt` describing the newest.
|
|
226
|
+
* **Google Play.** Uploads the AAB to the configured track (default `internal`) with the
|
|
227
|
+
Google Play Developer API (`pip install -e '.[play]'`) or `fastlane supply`.
|
|
228
|
+
* **TestFlight.** Uploads the IPA with an App Store Connect API key, through `xcrun altool`
|
|
229
|
+
(default) or `fastlane pilot`.
|
|
230
|
+
|
|
231
|
+
When Play or TestFlight credentials are missing, those uploads are **skipped with a message**
|
|
232
|
+
and the build and shared-folder copy still run.
|
|
233
|
+
|
|
234
|
+
**Store collision rule.** Current and legacy demos often share an applicationId or bundle id.
|
|
235
|
+
Only recipes with `store.play: true` or `store.testflight: true` are uploaded, and within one
|
|
236
|
+
run each id is uploaded once. The shipped recipes enable stores for `*-current` and `flutter`
|
|
237
|
+
and disable them for `*-legacy`.
|
|
238
|
+
|
|
239
|
+
## Recipes
|
|
240
|
+
|
|
241
|
+
A recipe has `demos` and `packages`, each a list of steps:
|
|
242
|
+
|
|
243
|
+
```yaml
|
|
244
|
+
recipes:
|
|
245
|
+
android-current:
|
|
246
|
+
platform: android
|
|
247
|
+
version: {file: gradle.properties, regex: '^\s*VERSION_NAME\s*=\s*(\S+)'}
|
|
248
|
+
store: {play: true, android_package: "${custom.app_ids.android_native:-com.example.demo}"}
|
|
249
|
+
demos:
|
|
250
|
+
- type: gradle
|
|
251
|
+
tasks: [":app:assembleRelease", ":app:bundleRelease"]
|
|
252
|
+
collect:
|
|
253
|
+
- {glob: "app/build/outputs/apk/release/*.apk", kind: apk, target: android-native-current}
|
|
254
|
+
- {glob: "app/build/outputs/bundle/release/*.aab", kind: aab}
|
|
255
|
+
```
|
|
256
|
+
|
|
257
|
+
| Step type | Runs |
|
|
258
|
+
| --- | --- |
|
|
259
|
+
| `run` | Any command (`cmd` as a list or a string, no shell) |
|
|
260
|
+
| `gradle` | `./gradlew <tasks>` with JAVA_HOME, Android SDK and optional release signing |
|
|
261
|
+
| `flutter` | `flutter <args>` |
|
|
262
|
+
| `xcode-simulator` | `xcodebuild` for the iOS Simulator; collects the `.app` |
|
|
263
|
+
| `xcode-ipa` | Archive and export an IPA (App Store Connect key used for automatic signing when set) |
|
|
264
|
+
| `xcframework` | Device and simulator archives combined into a zipped XCFramework |
|
|
265
|
+
| `npm-pack` | `npm pack` |
|
|
266
|
+
| `source-zip` | `git archive` of the committed sources (or a filtered file walk) |
|
|
267
|
+
|
|
268
|
+
Every step accepts `workdir` (relative to the checkout), `env`, `when: [play|testflight|onedrive]`
|
|
269
|
+
(run only when that destination is active, for example IPA archives only for TestFlight),
|
|
270
|
+
`host: macos` and `collect`.
|
|
271
|
+
|
|
272
|
+
Strings may use `${custom.dotted.key}`, `${env.NAME}`, `${version}` and `${recipe}`, with an
|
|
273
|
+
optional default: `${custom.ios_team_id:-}`.
|
|
274
|
+
|
|
275
|
+
The version comes from the recipe's `version` (a file plus regex, or a command), then
|
|
276
|
+
`git describe`, then a timestamp.
|
|
277
|
+
|
|
278
|
+
## Security model
|
|
279
|
+
|
|
280
|
+
* Secrets are never stored in the repository or in plain YAML. `keys.yaml` holds file paths
|
|
281
|
+
and references such as `{source: keychain, name: android.store_password}` or
|
|
282
|
+
`{source: env, name: ASC_KEY_ID}`. Values are read at run time.
|
|
283
|
+
* Settings files are written with mode `600` and the settings directory with mode `700`. Key
|
|
284
|
+
files uploaded through the UI are stored in `<settings>/keys/` with mode `600`.
|
|
285
|
+
* Android signing is passed to Gradle through `ORG_GRADLE_PROJECT_*` environment variables, not
|
|
286
|
+
the command line, so passwords do not show up in process listings.
|
|
287
|
+
* Every log line passes through a redactor that masks known secret values. The Keys page and
|
|
288
|
+
`status` command only report "configured" or "missing".
|
|
289
|
+
* The Settings UI binds to `127.0.0.1`, accepts only loopback `Host` headers, and requires a
|
|
290
|
+
per-process token on every API call, so other websites in your browser cannot drive it.
|
|
291
|
+
* `.gitignore` excludes settings files, staging output and key material.
|
|
292
|
+
|
|
293
|
+
## Output
|
|
294
|
+
|
|
295
|
+
Each real run writes `<staging>/runs/<timestamp>/` with the collected artifacts per recipe,
|
|
296
|
+
`log.txt` and `report.json` (selections, versions, commits, artifacts, upload results).
|
|
297
|
+
Intermediate build products (derived data, archives) are kept in `<staging>/work/` between
|
|
298
|
+
runs to speed up rebuilds.
|
|
299
|
+
|
|
300
|
+
## Contributing
|
|
301
|
+
|
|
302
|
+
See [CONTRIBUTING.md](https://github.com/yehyatt/sdk-release-kit/blob/main/CONTRIBUTING.md). AI coding agents should read [AGENTS.md](https://github.com/yehyatt/sdk-release-kit/blob/main/AGENTS.md)
|
|
303
|
+
first.
|
|
304
|
+
|
|
305
|
+
## License
|
|
306
|
+
|
|
307
|
+
MIT. See [LICENSE](https://github.com/yehyatt/sdk-release-kit/blob/main/LICENSE).
|