everkm-publish 0.17.2 → 0.17.4

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.2",
3
+ "version": "0.17.4",
4
4
  "description": "Everkm Publish CLI — npm wrapper with platform binaries",
5
5
  "repository": {
6
6
  "type": "git",
@@ -235,6 +235,22 @@ def npm_version_exists(version: str) -> bool:
235
235
  return False
236
236
 
237
237
 
238
+ def latest_json_version(s3_client: Any) -> str | None:
239
+ latest_key = "pkgs/latest.json"
240
+ try:
241
+ resp = s3_client.get_object(Bucket=R2_BUCKET, Key=latest_key)
242
+ data = json.loads(resp["Body"].read())
243
+ except ClientError as exc:
244
+ code = exc.response.get("Error", {}).get("Code")
245
+ if code in ("404", "NoSuchKey", "NotFound"):
246
+ return None
247
+ raise
248
+ except (json.JSONDecodeError, TypeError):
249
+ return None
250
+ version = data.get("version")
251
+ return version if isinstance(version, str) and version else None
252
+
253
+
238
254
  def cdn_assets_complete(s3_client: Any, version: str, asset_names: list[str]) -> bool:
239
255
  if not asset_names:
240
256
  return False
@@ -243,8 +259,7 @@ def cdn_assets_complete(s3_client: Any, version: str, asset_names: list[str]) ->
243
259
  return False
244
260
  if not object_exists(s3_client, pkg_key(version, "meta.json")):
245
261
  return False
246
- latest_key = "pkgs/latest.json"
247
- if not object_exists(s3_client, latest_key):
262
+ if latest_json_version(s3_client) != version:
248
263
  return False
249
264
  return True
250
265
 
@@ -348,7 +363,7 @@ def publish(
348
363
  s3_client,
349
364
  latest_path,
350
365
  "pkgs/latest.json",
351
- skip_if_exists=not force_cdn,
366
+ skip_if_exists=False,
352
367
  )
353
368
  cdn_refresh_urls(version, asset_names)
354
369