Fix pruned FFmpeg release inputs
Some checks failed
Core validation / Linux core gate (push) Successful in 56s
Release builds / Linux x64 artifact (push) Successful in 1m23s
Release builds / Windows x64 artifact (push) Successful in 1m15s
Release builds / Publish tagged Gitea release (push) Failing after 19s

This commit is contained in:
gamer147
2026-08-18 09:17:54 -04:00
parent 3a076e2781
commit eeecd1edba
8 changed files with 83 additions and 26 deletions

View File

@@ -1,6 +1,7 @@
#!/usr/bin/env python3
from __future__ import annotations
import json
import re
import unittest
from pathlib import Path
@@ -15,6 +16,10 @@ MANAGED_SOLUTION = REPO / "godot/OME.sln"
LINUX_BUILD = REPO / "tools/build-linux-x64.sh"
WINDOWS_BUILD = REPO / "tools/build-windows-x64.sh"
WINDOWS_HOSTED_EXPORT = REPO / "tools/export-linux-x64.ps1"
LINUX_FFMPEG_MANIFEST = REPO / "native/age_movie_ffmpeg/dependency-linux-x64.json"
WINDOWS_FFMPEG_MANIFEST = REPO / "native/age_movie_ffmpeg/dependency-win64.json"
LINUX_FFMPEG_BOOTSTRAP = REPO / "native/age_movie_ffmpeg/bootstrap-linux-x64.sh"
WINDOWS_FFMPEG_BOOTSTRAP = REPO / "native/age_movie_ffmpeg/bootstrap-win64.sh"
def job(text: str, name: str, next_name: str | None) -> str:
@@ -38,6 +43,25 @@ class ReleaseWorkflowTests(unittest.TestCase):
cls.windows_build = WINDOWS_BUILD.read_text(encoding="utf-8")
cls.windows_hosted_export = WINDOWS_HOSTED_EXPORT.read_text(encoding="utf-8")
def test_ffmpeg_inputs_are_dated_size_and_hash_pinned(self) -> None:
manifests = [
json.loads(LINUX_FFMPEG_MANIFEST.read_text(encoding="utf-8")),
json.loads(WINDOWS_FFMPEG_MANIFEST.read_text(encoding="utf-8")),
]
self.assertEqual(1, len({manifest["release_tag"] for manifest in manifests}))
for manifest in manifests:
self.assertRegex(manifest["release_tag"], r"^autobuild-\d{4}-\d{2}-\d{2}-\d{2}-\d{2}$")
self.assertNotEqual("latest", manifest["release_tag"])
self.assertIn(f"/{manifest['release_tag']}/", manifest["url"])
self.assertTrue(manifest["url"].endswith("/" + manifest["archive"]))
self.assertIn(manifest["ffmpeg_commit"], manifest["archive"])
self.assertGreater(manifest["size"], 50_000_000)
self.assertRegex(manifest["sha256"], r"^[0-9a-f]{64}$")
for bootstrap in (LINUX_FFMPEG_BOOTSTRAP, WINDOWS_FFMPEG_BOOTSTRAP):
text = bootstrap.read_text(encoding="utf-8")
self.assertIn("manifest_value size", text)
self.assertIn("--remove-on-error", text)
def test_public_build_outputs_use_ome_branding(self) -> None:
self.assertIn('export_path="../build/export/linux-x64/OME"', self.export_presets)
self.assertIn('export_path="../build/export/windows-x64/OME.exe"', self.export_presets)