everkm-publish 0.17.1 → 0.17.2

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "everkm-publish",
3
- "version": "0.17.1",
3
+ "version": "0.17.2",
4
4
  "description": "Everkm Publish CLI — npm wrapper with platform binaries",
5
5
  "repository": {
6
6
  "type": "git",
@@ -4,7 +4,7 @@
4
4
  publish-npm-package.py
5
5
 
6
6
  从 everkm/publish GitHub Release 拉取全部资产,镜像至 R2 / 七牛(pkgs/{ver}/),
7
- 生成 pkgs/latest.json(含上游 Release notes)。
7
+ 生成 pkgs/latest.json 与 pkgs/{ver}/meta.json(含上游 Release notes)。
8
8
 
9
9
  环境变量:
10
10
  - GH_TOKEN / GITHUB_TOKEN — 读 everkm/publish Release
@@ -241,6 +241,8 @@ def cdn_assets_complete(s3_client: Any, version: str, asset_names: list[str]) ->
241
241
  for name in asset_names:
242
242
  if not object_exists(s3_client, pkg_key(version, name)):
243
243
  return False
244
+ if not object_exists(s3_client, pkg_key(version, "meta.json")):
245
+ return False
244
246
  latest_key = "pkgs/latest.json"
245
247
  if not object_exists(s3_client, latest_key):
246
248
  return False
@@ -249,6 +251,7 @@ def cdn_assets_complete(s3_client: Any, version: str, asset_names: list[str]) ->
249
251
 
250
252
  def cdn_refresh_urls(version: str, asset_names: list[str]) -> None:
251
253
  urls = [f"{CDN_CN}/pkgs/{version}/{name}" for name in asset_names]
254
+ urls.append(f"{CDN_CN}/pkgs/{version}/meta.json")
252
255
  urls.append(f"{CDN_CN}/pkgs/latest.json")
253
256
  ak = os.environ.get("QINIU_ACCESS_KEY")
254
257
  sk = os.environ.get("QINIU_SECRET_KEY")
@@ -324,10 +327,22 @@ def publish(
324
327
  skip_if_exists=not force_cdn,
325
328
  )
326
329
 
327
- latest = build_latest_json(version, tag, notes, asset_names)
330
+ meta = build_latest_json(version, tag, notes, asset_names)
331
+
332
+ meta_path = work_dir / "meta.json"
333
+ with meta_path.open("w", encoding="utf-8") as f:
334
+ json.dump(meta, f, indent=2, ensure_ascii=False)
335
+ f.write("\n")
336
+ upload_file_both(
337
+ s3_client,
338
+ meta_path,
339
+ pkg_key(version, "meta.json"),
340
+ skip_if_exists=not force_cdn,
341
+ )
342
+
328
343
  latest_path = work_dir / "latest.json"
329
344
  with latest_path.open("w", encoding="utf-8") as f:
330
- json.dump(latest, f, indent=2, ensure_ascii=False)
345
+ json.dump(meta, f, indent=2, ensure_ascii=False)
331
346
  f.write("\n")
332
347
  upload_file_both(
333
348
  s3_client,