feat: Add validation for macOS installer entries and enhance error handling in release creation script
Some checks are pending
Tests & Quality Checks / Test on Python 3.11 (push) Waiting to run
Tests & Quality Checks / Test on Python 3.12 (push) Waiting to run
Tests & Quality Checks / Test on Python 3.11-1 (push) Waiting to run
Tests & Quality Checks / Test on Python 3.12-1 (push) Waiting to run
Tests & Quality Checks / Test on Python 3.10 (push) Waiting to run
Tests & Quality Checks / Test on Python 3.11-2 (push) Waiting to run
Tests & Quality Checks / Test on Python 3.12-2 (push) Waiting to run
Tests & Quality Checks / Build Artifacts (push) Blocked by required conditions
Tests & Quality Checks / Build Artifacts-1 (push) Blocked by required conditions
Some checks are pending
Tests & Quality Checks / Test on Python 3.11 (push) Waiting to run
Tests & Quality Checks / Test on Python 3.12 (push) Waiting to run
Tests & Quality Checks / Test on Python 3.11-1 (push) Waiting to run
Tests & Quality Checks / Test on Python 3.12-1 (push) Waiting to run
Tests & Quality Checks / Test on Python 3.10 (push) Waiting to run
Tests & Quality Checks / Test on Python 3.11-2 (push) Waiting to run
Tests & Quality Checks / Test on Python 3.12-2 (push) Waiting to run
Tests & Quality Checks / Build Artifacts (push) Blocked by required conditions
Tests & Quality Checks / Build Artifacts-1 (push) Blocked by required conditions
This commit is contained in:
parent
d6f4140947
commit
93316c7e2f
2 changed files with 58 additions and 1 deletions
|
|
@ -59,6 +59,58 @@ for artifact in data["artifacts"]:
|
|||
PY
|
||||
)
|
||||
|
||||
VALIDATION_RESULT=$(python3 - "$LOCAL_DATA_OUTPUT" "$LOCAL_MANIFEST_OUTPUT" <<'PY'
|
||||
import json
|
||||
import sys
|
||||
from pathlib import Path
|
||||
|
||||
data = json.loads(Path(sys.argv[1]).read_text(encoding="utf-8"))
|
||||
manifest = json.loads(Path(sys.argv[2]).read_text(encoding="utf-8"))
|
||||
|
||||
selected_brands = data.get("brands", [])
|
||||
manifest_brands = manifest.get("brands", {})
|
||||
missing = []
|
||||
|
||||
for brand_id in selected_brands:
|
||||
platform_entry = manifest_brands.get(brand_id, {}).get("macos-universal", {})
|
||||
installer_name = platform_entry.get("installer", "")
|
||||
if not installer_name:
|
||||
missing.append(brand_id)
|
||||
|
||||
if missing:
|
||||
print("MISSING:" + ",".join(missing))
|
||||
else:
|
||||
print("OK")
|
||||
PY
|
||||
)
|
||||
|
||||
if [[ "$VALIDATION_RESULT" == MISSING:* ]]; then
|
||||
MISSING_BRANDS="${VALIDATION_RESULT#MISSING:}"
|
||||
echo "ERROR: release-manifest.json is missing macos-universal installer entries for brand(s): $MISSING_BRANDS"
|
||||
echo "Build the missing brand(s) first or check artifact naming/version before creating the release."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [ ${#BRANDS[@]} -gt 0 ]; then
|
||||
FOUND_BRANDS_CSV=$(python3 - "$LOCAL_DATA_OUTPUT" <<'PY'
|
||||
import json
|
||||
import sys
|
||||
from pathlib import Path
|
||||
|
||||
data = json.loads(Path(sys.argv[1]).read_text(encoding="utf-8"))
|
||||
print(",".join(data.get("brands", [])))
|
||||
PY
|
||||
)
|
||||
|
||||
for REQUESTED_BRAND in "${BRANDS[@]}"; do
|
||||
if [[ ",$FOUND_BRANDS_CSV," != *",$REQUESTED_BRAND,"* ]]; then
|
||||
echo "ERROR: Requested brand '$REQUESTED_BRAND' has no local macOS artifact for version $VERSION"
|
||||
echo "Run build/scripts/build_macos.sh --brand $REQUESTED_BRAND first, then retry release creation."
|
||||
exit 1
|
||||
fi
|
||||
done
|
||||
fi
|
||||
|
||||
for ARTIFACT in "${ARTIFACTS[@]}"; do
|
||||
if [ -f "$ARTIFACT" ] && [ "${ARTIFACT##*.}" = "dmg" ]; then
|
||||
DMG_SIZE=$(du -m "$ARTIFACT" | cut -f1)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue