Rename release outputs and managed project to OME
Some checks failed
Some checks failed
This commit is contained in:
@@ -39,7 +39,7 @@ DOTNET_CLI_USE_MSBUILD_SERVER=0 \
|
||||
MSBUILDDISABLENODEREUSE=1 \
|
||||
DOTNET_gcServer=0 \
|
||||
DOTNET_GCConserveMemory=9 \
|
||||
dotnet publish "$project_root/Himegari.csproj" \
|
||||
dotnet publish "$project_root/OME.csproj" \
|
||||
--configuration ExportRelease \
|
||||
--runtime linux-x64 \
|
||||
--self-contained true \
|
||||
@@ -61,7 +61,7 @@ if [[ "$managed_proxy_directory" != "$expected_managed_proxy_directory" || "$man
|
||||
fi
|
||||
rm -rf -- "$managed_proxy_directory"
|
||||
mkdir -p -- "$managed_proxy_directory"
|
||||
cp -- "$managed_publish_directory/Himegari.dll" "$managed_proxy_directory/Himegari.dll"
|
||||
cp -- "$managed_publish_directory/OME.dll" "$managed_proxy_directory/OME.dll"
|
||||
|
||||
real_dotnet="$(command -v dotnet)"
|
||||
expected_dotnet_proxy_directory="$repo_root/build/dotnet-export-proxy"
|
||||
@@ -90,15 +90,15 @@ RestoreDisableParallel=true \
|
||||
DOTNET_gcServer=0 \
|
||||
DOTNET_GCConserveMemory=9 \
|
||||
AGE_REAL_DOTNET="$real_dotnet" \
|
||||
AGE_PUBLISH_PROJECT="$project_root/Himegari.csproj" \
|
||||
AGE_PUBLISH_PROJECT="$project_root/OME.csproj" \
|
||||
AGE_PREPUBLISHED_OUTPUT="$managed_proxy_directory" \
|
||||
AGE_PUBLISH_OUTPUT_ROOT="${TMPDIR:-/tmp}/godot-publish-dotnet" \
|
||||
AGE_PUBLISH_ASSEMBLY="Himegari.dll" \
|
||||
AGE_PUBLISH_ASSEMBLY="OME.dll" \
|
||||
AGE_PUBLISH_RUNTIME="linux-x64" \
|
||||
PATH="$dotnet_proxy_directory:$PATH" \
|
||||
XDG_DATA_HOME="$xdg_data_home" "$godot_console" \
|
||||
--headless --quit-after 120 --path "$project_root" \
|
||||
--export-release "Linux x86_64" "$export_directory/Himegari.x86_64"
|
||||
--export-release "Linux x86_64" "$export_directory/OME"
|
||||
export_status=$?
|
||||
set -e
|
||||
if [[ $export_status -ne 0 ]]; then
|
||||
@@ -108,8 +108,8 @@ if [[ $export_status -ne 0 ]]; then
|
||||
exit "$export_status"
|
||||
fi
|
||||
|
||||
managed_export_directory="$export_directory/data_Himegari_linuxbsd_x86_64"
|
||||
expected_managed_export_directory="$repo_root/build/export/linux-x64/data_Himegari_linuxbsd_x86_64"
|
||||
managed_export_directory="$export_directory/data_OME_linuxbsd_x86_64"
|
||||
expected_managed_export_directory="$repo_root/build/export/linux-x64/data_OME_linuxbsd_x86_64"
|
||||
if [[ "$managed_export_directory" != "$expected_managed_export_directory" || "$managed_export_directory" == "/" ]]; then
|
||||
echo "refusing to replace unexpected managed export directory: $managed_export_directory" >&2
|
||||
exit 1
|
||||
@@ -131,7 +131,7 @@ package_root="${package_outputs[0]}"
|
||||
archive_path="${package_outputs[1]}"
|
||||
smoke_log="$package_directory/package-smoke.log"
|
||||
set +e
|
||||
"$package_root/Himegari.x86_64" --headless -- --package-smoke >"$smoke_log" 2>&1
|
||||
"$package_root/OME" --headless -- --package-smoke >"$smoke_log" 2>&1
|
||||
smoke_status=$?
|
||||
set -e
|
||||
cat "$smoke_log"
|
||||
|
||||
@@ -39,7 +39,7 @@ DOTNET_CLI_USE_MSBUILD_SERVER=0 \
|
||||
MSBUILDDISABLENODEREUSE=1 \
|
||||
DOTNET_gcServer=0 \
|
||||
DOTNET_GCConserveMemory=9 \
|
||||
dotnet publish "$project_root/Himegari.csproj" \
|
||||
dotnet publish "$project_root/OME.csproj" \
|
||||
--configuration ExportRelease \
|
||||
--runtime win-x64 \
|
||||
--self-contained true \
|
||||
@@ -58,7 +58,7 @@ if [[ "$managed_proxy_directory" != "$expected_managed_proxy_directory" || "$man
|
||||
fi
|
||||
rm -rf -- "$managed_proxy_directory"
|
||||
mkdir -p -- "$managed_proxy_directory"
|
||||
cp -- "$managed_publish_directory/Himegari.dll" "$managed_proxy_directory/Himegari.dll"
|
||||
cp -- "$managed_publish_directory/OME.dll" "$managed_proxy_directory/OME.dll"
|
||||
|
||||
real_dotnet="$(command -v dotnet)"
|
||||
expected_dotnet_proxy_directory="$repo_root/build/dotnet-export-proxy"
|
||||
@@ -87,15 +87,15 @@ RestoreDisableParallel=true \
|
||||
DOTNET_gcServer=0 \
|
||||
DOTNET_GCConserveMemory=9 \
|
||||
AGE_REAL_DOTNET="$real_dotnet" \
|
||||
AGE_PUBLISH_PROJECT="$project_root/Himegari.csproj" \
|
||||
AGE_PUBLISH_PROJECT="$project_root/OME.csproj" \
|
||||
AGE_PREPUBLISHED_OUTPUT="$managed_proxy_directory" \
|
||||
AGE_PUBLISH_OUTPUT_ROOT="${TMPDIR:-/tmp}/godot-publish-dotnet" \
|
||||
AGE_PUBLISH_ASSEMBLY="Himegari.dll" \
|
||||
AGE_PUBLISH_ASSEMBLY="OME.dll" \
|
||||
AGE_PUBLISH_RUNTIME="win-x64" \
|
||||
PATH="$dotnet_proxy_directory:$PATH" \
|
||||
XDG_DATA_HOME="$xdg_data_home" "$godot_console" \
|
||||
--headless --quit-after 120 --path "$project_root" \
|
||||
--export-release "Windows x86_64" "$export_directory/Himegari.exe"
|
||||
--export-release "Windows x86_64" "$export_directory/OME.exe"
|
||||
export_status=$?
|
||||
set -e
|
||||
if [[ $export_status -ne 0 ]]; then
|
||||
@@ -105,8 +105,8 @@ if [[ $export_status -ne 0 ]]; then
|
||||
exit "$export_status"
|
||||
fi
|
||||
|
||||
managed_export_directory="$export_directory/data_Himegari_windows_x86_64"
|
||||
expected_managed_export_directory="$repo_root/build/export/windows-x64/data_Himegari_windows_x86_64"
|
||||
managed_export_directory="$export_directory/data_OME_windows_x86_64"
|
||||
expected_managed_export_directory="$repo_root/build/export/windows-x64/data_OME_windows_x86_64"
|
||||
if [[ "$managed_export_directory" != "$expected_managed_export_directory" || "$managed_export_directory" == "/" ]]; then
|
||||
echo "refusing to replace unexpected managed export directory: $managed_export_directory" >&2
|
||||
exit 1
|
||||
|
||||
@@ -9,13 +9,13 @@ $projectRoot = Join-Path $repoRoot 'godot'
|
||||
$godotConsolePath = (Resolve-Path -LiteralPath $GodotConsole).Path
|
||||
$outputDirectory = [System.IO.Path]::GetFullPath((Join-Path $repoRoot 'build\export\linux-x64'))
|
||||
$expectedOutputDirectory = [System.IO.Path]::GetFullPath((Join-Path $repoRoot 'build\export\linux-x64'))
|
||||
$executable = Join-Path $outputDirectory 'Himegari.x86_64'
|
||||
$executable = Join-Path $outputDirectory 'OME'
|
||||
|
||||
if (-not (Test-Path -LiteralPath $godotConsolePath -PathType Leaf)) {
|
||||
throw "Godot console executable was not found: $godotConsolePath"
|
||||
}
|
||||
foreach ($required in @(
|
||||
(Join-Path $projectRoot 'Himegari.sln'),
|
||||
(Join-Path $projectRoot 'OME.sln'),
|
||||
(Join-Path $projectRoot 'export_presets.cfg'),
|
||||
(Join-Path $repoRoot 'build\native\linux-x64\libage_movie_ffmpeg.so')
|
||||
)) {
|
||||
|
||||
@@ -15,12 +15,12 @@ from pathlib import Path
|
||||
|
||||
HERE = Path(__file__).resolve().parent
|
||||
REPO = HERE.parent
|
||||
MANAGED_DIRECTORY = "data_Himegari_linuxbsd_x86_64"
|
||||
PACKAGE_NAME = "OpenMaidEngine-Himegari-linux-x64"
|
||||
MANAGED_DIRECTORY = "data_OME_linuxbsd_x86_64"
|
||||
PACKAGE_NAME = "OME-linux-x64"
|
||||
REQUIRED_FILES = (
|
||||
"Himegari.x86_64",
|
||||
"Himegari.pck",
|
||||
f"{MANAGED_DIRECTORY}/Himegari.dll",
|
||||
"OME",
|
||||
"OME.pck",
|
||||
f"{MANAGED_DIRECTORY}/OME.dll",
|
||||
f"{MANAGED_DIRECTORY}/Age.Engine.dll",
|
||||
f"{MANAGED_DIRECTORY}/Age.Engine.Frontend.dll",
|
||||
f"{MANAGED_DIRECTORY}/libage_movie_ffmpeg.so",
|
||||
@@ -36,6 +36,7 @@ FORBIDDEN_FILES = (
|
||||
f"{MANAGED_DIRECTORY}/age_movie_ffmpeg.dll",
|
||||
f"{MANAGED_DIRECTORY}/avformat-62.dll",
|
||||
)
|
||||
LEGACY_FILES = (f"{MANAGED_DIRECTORY}/Himegari.dll",)
|
||||
PROJECT_FILES = ("LICENSE", "README.md", "THIRD_PARTY_NOTICES.md")
|
||||
|
||||
|
||||
@@ -54,7 +55,10 @@ def verify_export(export_directory: Path) -> Path:
|
||||
forbidden = [name for name in FORBIDDEN_FILES if (export_directory / name).exists()]
|
||||
if forbidden:
|
||||
raise ValueError("Linux export contains Windows-only files: " + ", ".join(forbidden))
|
||||
executable = export_directory / "Himegari.x86_64"
|
||||
legacy = [name for name in LEGACY_FILES if (export_directory / name).exists()]
|
||||
if legacy:
|
||||
raise ValueError("Linux export contains legacy-branded files: " + ", ".join(legacy))
|
||||
executable = export_directory / "OME"
|
||||
if os.name != "nt" and not os.access(executable, os.X_OK):
|
||||
raise ValueError(f"Linux export executable bit is not set: {executable}")
|
||||
return export_directory
|
||||
@@ -89,7 +93,7 @@ def build_metadata(epoch: int) -> dict[str, object]:
|
||||
dirty = bool(_git("status", "--porcelain", "--untracked-files=normal"))
|
||||
return {
|
||||
"schema_version": 1,
|
||||
"project": "OpenMaidEngine Himegari profile",
|
||||
"project": "Open Maid Engine",
|
||||
"target": "linux-x64",
|
||||
"source_commit": _git("rev-parse", "HEAD"),
|
||||
"source_dirty": dirty,
|
||||
|
||||
@@ -18,12 +18,12 @@ import verify_windows_native
|
||||
|
||||
HERE = Path(__file__).resolve().parent
|
||||
REPO = HERE.parent
|
||||
MANAGED_DIRECTORY = "data_Himegari_windows_x86_64"
|
||||
PACKAGE_NAME = "OpenMaidEngine-Himegari-windows-x64"
|
||||
MANAGED_DIRECTORY = "data_OME_windows_x86_64"
|
||||
PACKAGE_NAME = "OME-windows-x64"
|
||||
REQUIRED_FILES = (
|
||||
"Himegari.exe",
|
||||
"Himegari.pck",
|
||||
f"{MANAGED_DIRECTORY}/Himegari.dll",
|
||||
"OME.exe",
|
||||
"OME.pck",
|
||||
f"{MANAGED_DIRECTORY}/OME.dll",
|
||||
f"{MANAGED_DIRECTORY}/Age.Engine.dll",
|
||||
f"{MANAGED_DIRECTORY}/Age.Engine.Frontend.dll",
|
||||
f"{MANAGED_DIRECTORY}/Age.Engine.Text.Windows.dll",
|
||||
@@ -34,10 +34,11 @@ REQUIRED_FILES = (
|
||||
*(f"{MANAGED_DIRECTORY}/{name}" for name in verify_windows_native.REQUIRED_FILES),
|
||||
)
|
||||
FORBIDDEN_FILES = (
|
||||
"Himegari.x86_64",
|
||||
"OME",
|
||||
f"{MANAGED_DIRECTORY}/libage_movie_ffmpeg.so",
|
||||
f"{MANAGED_DIRECTORY}/libavformat.so.62",
|
||||
)
|
||||
LEGACY_FILES = (f"{MANAGED_DIRECTORY}/Himegari.dll",)
|
||||
PROJECT_FILES = ("LICENSE", "README.md", "THIRD_PARTY_NOTICES.md")
|
||||
|
||||
|
||||
@@ -61,10 +62,13 @@ def verify_export(export_directory: Path, objdump: str) -> tuple[Path, dict[str,
|
||||
)
|
||||
if forbidden:
|
||||
raise ValueError("Windows export contains Linux-only files: " + ", ".join(sorted(set(forbidden))))
|
||||
executable_machine = verify_windows_native.pe_machine(export_directory / "Himegari.exe")
|
||||
legacy = [name for name in LEGACY_FILES if (export_directory / name).exists()]
|
||||
if legacy:
|
||||
raise ValueError("Windows export contains legacy-branded files: " + ", ".join(legacy))
|
||||
executable_machine = verify_windows_native.pe_machine(export_directory / "OME.exe")
|
||||
if executable_machine != verify_windows_native.PE_MACHINE_AMD64:
|
||||
raise ValueError(
|
||||
f"Windows executable is not AMD64 PE (0x{executable_machine:04x}): Himegari.exe"
|
||||
f"Windows executable is not AMD64 PE (0x{executable_machine:04x}): OME.exe"
|
||||
)
|
||||
native_report = verify_windows_native.verify_bundle(
|
||||
export_directory / MANAGED_DIRECTORY,
|
||||
@@ -113,7 +117,7 @@ def build_metadata(epoch: int) -> dict[str, object]:
|
||||
ffmpeg = json.load(stream)
|
||||
return {
|
||||
"schema_version": 1,
|
||||
"project": "OpenMaidEngine Himegari profile",
|
||||
"project": "Open Maid Engine",
|
||||
"target": "win-x64",
|
||||
"source_commit": _git("rev-parse", "HEAD"),
|
||||
"source_dirty": bool(_git("status", "--porcelain", "--untracked-files=normal")),
|
||||
|
||||
@@ -20,8 +20,8 @@ from typing import Any, Callable, Protocol
|
||||
import verify_windows_native
|
||||
|
||||
|
||||
LINUX_ARCHIVE = "OpenMaidEngine-Himegari-linux-x64.tar.gz"
|
||||
WINDOWS_ARCHIVE = "OpenMaidEngine-Himegari-windows-x64.zip"
|
||||
LINUX_ARCHIVE = "OME-linux-x64.tar.gz"
|
||||
WINDOWS_ARCHIVE = "OME-windows-x64.zip"
|
||||
RELEASE_CHECKSUMS = "RELEASE-SHA256SUMS"
|
||||
LINUX_ARTIFACT_FILES = frozenset({
|
||||
LINUX_ARCHIVE,
|
||||
@@ -38,8 +38,8 @@ WINDOWS_ARTIFACT_FILES = frozenset({
|
||||
"WINDOWS-VERIFICATION.json",
|
||||
})
|
||||
EXPECTED_RELEASE_ASSETS = frozenset({LINUX_ARCHIVE, WINDOWS_ARCHIVE, RELEASE_CHECKSUMS})
|
||||
LINUX_PACKAGE_ROOT = "OpenMaidEngine-Himegari-linux-x64"
|
||||
WINDOWS_PACKAGE_ROOT = "OpenMaidEngine-Himegari-windows-x64"
|
||||
LINUX_PACKAGE_ROOT = "OME-linux-x64"
|
||||
WINDOWS_PACKAGE_ROOT = "OME-windows-x64"
|
||||
SMOKE_MARKER = "PACKAGE SMOKE OK: opcodes=548 ffmpeg-abi=3"
|
||||
TAG_PATTERN = re.compile(r"v[0-9][0-9A-Za-z.+-]*\Z")
|
||||
COMMIT_PATTERN = re.compile(r"[0-9a-f]{40}\Z")
|
||||
@@ -279,8 +279,8 @@ def _validate_windows_verification(data: bytes) -> None:
|
||||
}
|
||||
if native.get("schema_version") != 1 or native.get("target") != "win-x64":
|
||||
mismatches["native"] = ((native.get("schema_version"), native.get("target")), (1, "win-x64"))
|
||||
if native.get("bundle") != "data_Himegari_windows_x86_64":
|
||||
mismatches["bundle"] = (native.get("bundle"), "data_Himegari_windows_x86_64")
|
||||
if native.get("bundle") != "data_OME_windows_x86_64":
|
||||
mismatches["bundle"] = (native.get("bundle"), "data_OME_windows_x86_64")
|
||||
if machines != expected_machines:
|
||||
mismatches["machines"] = (machines, expected_machines)
|
||||
exports_value = native.get("shim_exports")
|
||||
@@ -361,9 +361,9 @@ def prepare_release_assets(
|
||||
if external != internal:
|
||||
raise ValueError(f"external and packaged {label} do not match")
|
||||
|
||||
if b" Himegari.x86_64\n" not in linux_ledger:
|
||||
if b" OME\n" not in linux_ledger:
|
||||
raise ValueError("Linux SHA256SUMS does not contain the packaged executable")
|
||||
if b" Himegari.exe\n" not in windows_ledger:
|
||||
if b" OME.exe\n" not in windows_ledger:
|
||||
raise ValueError("Windows SHA256SUMS does not contain the packaged executable")
|
||||
|
||||
output_directory = output_directory.resolve()
|
||||
@@ -410,7 +410,7 @@ def promote_release(
|
||||
)
|
||||
if {asset.name for asset in assets} != EXPECTED_RELEASE_ASSETS:
|
||||
raise RuntimeError("prepared release asset set is invalid")
|
||||
title = f"OpenMaidEngine Himegari {tag}"
|
||||
title = f"Open Maid Engine {tag}"
|
||||
release = api.get_release(tag)
|
||||
if release is None:
|
||||
release = api.create_release({
|
||||
|
||||
@@ -12,11 +12,11 @@ class DotnetPublishProxyTests(unittest.TestCase):
|
||||
def test_stages_exact_expected_publish(self) -> None:
|
||||
with tempfile.TemporaryDirectory() as temporary:
|
||||
root = Path(temporary)
|
||||
project = root / "Himegari.csproj"
|
||||
project = root / "OME.csproj"
|
||||
project.write_text("<Project />", encoding="utf-8")
|
||||
source = root / "prepublished"
|
||||
source.mkdir()
|
||||
(source / "Himegari.dll").write_bytes(b"managed")
|
||||
(source / "OME.dll").write_bytes(b"managed")
|
||||
(source / "libhostfxr.so").write_bytes(b"runtime")
|
||||
output_root = root / "godot-publish-dotnet"
|
||||
output = output_root / "123-ExportRelease-linux-x64"
|
||||
@@ -29,26 +29,26 @@ class DotnetPublishProxyTests(unittest.TestCase):
|
||||
"AGE_PUBLISH_PROJECT": str(project),
|
||||
"AGE_PREPUBLISHED_OUTPUT": str(source),
|
||||
"AGE_PUBLISH_OUTPUT_ROOT": str(output_root),
|
||||
"AGE_PUBLISH_ASSEMBLY": "Himegari.dll",
|
||||
"AGE_PUBLISH_ASSEMBLY": "OME.dll",
|
||||
"AGE_PUBLISH_RUNTIME": "linux-x64",
|
||||
})
|
||||
self.assertEqual(output.resolve(), staged)
|
||||
self.assertEqual(b"managed", (staged / "Himegari.dll").read_bytes())
|
||||
self.assertEqual(b"managed", (staged / "OME.dll").read_bytes())
|
||||
self.assertEqual(b"runtime", (staged / "libhostfxr.so").read_bytes())
|
||||
|
||||
def test_rejects_drift_and_output_escape(self) -> None:
|
||||
with tempfile.TemporaryDirectory() as temporary:
|
||||
root = Path(temporary)
|
||||
project = root / "Himegari.csproj"
|
||||
project = root / "OME.csproj"
|
||||
project.write_text("<Project />", encoding="utf-8")
|
||||
source = root / "prepublished"
|
||||
source.mkdir()
|
||||
(source / "Himegari.dll").write_bytes(b"managed")
|
||||
(source / "OME.dll").write_bytes(b"managed")
|
||||
environment = {
|
||||
"AGE_PUBLISH_PROJECT": str(project),
|
||||
"AGE_PREPUBLISHED_OUTPUT": str(source),
|
||||
"AGE_PUBLISH_OUTPUT_ROOT": str(root / "reserved"),
|
||||
"AGE_PUBLISH_ASSEMBLY": "Himegari.dll",
|
||||
"AGE_PUBLISH_ASSEMBLY": "OME.dll",
|
||||
"AGE_PUBLISH_RUNTIME": "linux-x64",
|
||||
}
|
||||
wrong_runtime = dotnet_publish_proxy.PublishRequest(
|
||||
@@ -65,11 +65,11 @@ class DotnetPublishProxyTests(unittest.TestCase):
|
||||
def test_stages_windows_publish_when_explicitly_selected(self) -> None:
|
||||
with tempfile.TemporaryDirectory() as temporary:
|
||||
root = Path(temporary)
|
||||
project = root / "Himegari.csproj"
|
||||
project = root / "OME.csproj"
|
||||
project.write_text("<Project />", encoding="utf-8")
|
||||
source = root / "prepublished"
|
||||
source.mkdir()
|
||||
(source / "Himegari.dll").write_bytes(b"managed")
|
||||
(source / "OME.dll").write_bytes(b"managed")
|
||||
output = root / "reserved/123-ExportRelease-win-x64"
|
||||
request = dotnet_publish_proxy.PublishRequest(
|
||||
project, "ExportRelease", "win-x64", "true", output
|
||||
@@ -78,7 +78,7 @@ class DotnetPublishProxyTests(unittest.TestCase):
|
||||
"AGE_PUBLISH_PROJECT": str(project),
|
||||
"AGE_PREPUBLISHED_OUTPUT": str(source),
|
||||
"AGE_PUBLISH_OUTPUT_ROOT": str(root / "reserved"),
|
||||
"AGE_PUBLISH_ASSEMBLY": "Himegari.dll",
|
||||
"AGE_PUBLISH_ASSEMBLY": "OME.dll",
|
||||
"AGE_PUBLISH_RUNTIME": "win-x64",
|
||||
})
|
||||
self.assertEqual(output.resolve(), staged)
|
||||
|
||||
@@ -16,11 +16,24 @@ def make_export(root: Path) -> Path:
|
||||
path = export / relative
|
||||
path.parent.mkdir(parents=True, exist_ok=True)
|
||||
path.write_bytes(f"fixture:{relative}".encode())
|
||||
(export / "Himegari.x86_64").chmod(0o755)
|
||||
(export / "OME").chmod(0o755)
|
||||
return export
|
||||
|
||||
|
||||
class PackageLinuxX64Tests(unittest.TestCase):
|
||||
def test_public_output_names_use_ome_branding(self) -> None:
|
||||
self.assertEqual("OME-linux-x64", package_linux_x64.PACKAGE_NAME)
|
||||
self.assertIn("OME", package_linux_x64.REQUIRED_FILES)
|
||||
self.assertIn("OME.pck", package_linux_x64.REQUIRED_FILES)
|
||||
self.assertIn(
|
||||
f"{package_linux_x64.MANAGED_DIRECTORY}/OME.dll",
|
||||
package_linux_x64.REQUIRED_FILES,
|
||||
)
|
||||
self.assertIn(
|
||||
f"{package_linux_x64.MANAGED_DIRECTORY}/Himegari.dll",
|
||||
package_linux_x64.LEGACY_FILES,
|
||||
)
|
||||
|
||||
def test_verify_rejects_missing_and_windows_files(self) -> None:
|
||||
with tempfile.TemporaryDirectory() as temporary:
|
||||
export = make_export(Path(temporary))
|
||||
@@ -33,12 +46,17 @@ class PackageLinuxX64Tests(unittest.TestCase):
|
||||
forbidden.write_bytes(b"windows")
|
||||
with self.assertRaisesRegex(ValueError, "Windows-only"):
|
||||
package_linux_x64.verify_export(export)
|
||||
forbidden.unlink()
|
||||
legacy = export / package_linux_x64.LEGACY_FILES[0]
|
||||
legacy.write_bytes(b"legacy")
|
||||
with self.assertRaisesRegex(ValueError, "legacy-branded"):
|
||||
package_linux_x64.verify_export(export)
|
||||
|
||||
@unittest.skipIf(package_linux_x64.os.name == "nt", "executable-bit gate is POSIX-only")
|
||||
def test_verify_requires_executable_bit_on_posix(self) -> None:
|
||||
with tempfile.TemporaryDirectory() as temporary:
|
||||
export = make_export(Path(temporary))
|
||||
(export / "Himegari.x86_64").chmod(0o644)
|
||||
(export / "OME").chmod(0o644)
|
||||
with self.assertRaisesRegex(ValueError, "executable bit"):
|
||||
package_linux_x64.verify_export(export)
|
||||
|
||||
@@ -65,7 +83,7 @@ class PackageLinuxX64Tests(unittest.TestCase):
|
||||
self.assertTrue((package_root / "LICENSE").is_file())
|
||||
self.assertTrue((package_root / "BUILD-INFO.json").is_file())
|
||||
checksums = (package_root / "SHA256SUMS").read_text(encoding="utf-8")
|
||||
self.assertIn("Himegari.x86_64", checksums)
|
||||
self.assertIn("OME", checksums)
|
||||
self.assertIn("THIRD_PARTY_NOTICES.md", checksums)
|
||||
|
||||
|
||||
|
||||
@@ -33,7 +33,7 @@ def make_export(root: Path) -> Path:
|
||||
path = export / relative
|
||||
path.parent.mkdir(parents=True, exist_ok=True)
|
||||
path.write_bytes(f"fixture:{relative}".encode())
|
||||
write_pe(export / "Himegari.exe")
|
||||
write_pe(export / "OME.exe")
|
||||
managed = export / package_windows_x64.MANAGED_DIRECTORY
|
||||
for name in (verify_windows_native.SHIM, *verify_windows_native.RUNTIME_DLLS):
|
||||
write_pe(managed / name)
|
||||
@@ -41,6 +41,19 @@ def make_export(root: Path) -> Path:
|
||||
|
||||
|
||||
class PackageWindowsX64Tests(unittest.TestCase):
|
||||
def test_public_output_names_use_ome_branding(self) -> None:
|
||||
self.assertEqual("OME-windows-x64", package_windows_x64.PACKAGE_NAME)
|
||||
self.assertIn("OME.exe", package_windows_x64.REQUIRED_FILES)
|
||||
self.assertIn("OME.pck", package_windows_x64.REQUIRED_FILES)
|
||||
self.assertIn(
|
||||
f"{package_windows_x64.MANAGED_DIRECTORY}/OME.dll",
|
||||
package_windows_x64.REQUIRED_FILES,
|
||||
)
|
||||
self.assertIn(
|
||||
f"{package_windows_x64.MANAGED_DIRECTORY}/Himegari.dll",
|
||||
package_windows_x64.LEGACY_FILES,
|
||||
)
|
||||
|
||||
def test_verify_rejects_missing_linux_and_wrong_machine_files(self) -> None:
|
||||
with tempfile.TemporaryDirectory() as temporary:
|
||||
export = make_export(Path(temporary))
|
||||
@@ -56,7 +69,12 @@ class PackageWindowsX64Tests(unittest.TestCase):
|
||||
with self.assertRaisesRegex(ValueError, "Linux-only"):
|
||||
package_windows_x64.verify_export(export, "objdump")
|
||||
linux.unlink()
|
||||
write_pe(export / "Himegari.exe", machine=0x014C)
|
||||
legacy = export / package_windows_x64.LEGACY_FILES[0]
|
||||
legacy.write_bytes(b"legacy")
|
||||
with self.assertRaisesRegex(ValueError, "legacy-branded"):
|
||||
package_windows_x64.verify_export(export, "objdump")
|
||||
legacy.unlink()
|
||||
write_pe(export / "OME.exe", machine=0x014C)
|
||||
with self.assertRaisesRegex(ValueError, "not AMD64"):
|
||||
package_windows_x64.verify_export(export, "objdump")
|
||||
|
||||
@@ -88,7 +106,7 @@ class PackageWindowsX64Tests(unittest.TestCase):
|
||||
self.assertTrue((package_root / "BUILD-INFO.json").is_file())
|
||||
self.assertTrue((package_root / "WINDOWS-VERIFICATION.json").is_file())
|
||||
checksums = (package_root / "SHA256SUMS").read_text(encoding="utf-8")
|
||||
self.assertIn("Himegari.exe", checksums)
|
||||
self.assertIn("OME.exe", checksums)
|
||||
self.assertIn("THIRD_PARTY_NOTICES.md", checksums)
|
||||
|
||||
|
||||
|
||||
@@ -49,7 +49,7 @@ def matching_release() -> dict[str, Any]:
|
||||
"id": 17,
|
||||
"tag_name": TAG,
|
||||
"target_commitish": TARGET,
|
||||
"name": f"OpenMaidEngine Himegari {TAG}",
|
||||
"name": f"Open Maid Engine {TAG}",
|
||||
"draft": False,
|
||||
"prerelease": False,
|
||||
"html_url": "https://gitea.invalid/releases/tag/v0.2.0",
|
||||
@@ -77,7 +77,7 @@ def windows_verification() -> bytes:
|
||||
"native": {
|
||||
"schema_version": 1,
|
||||
"target": "win-x64",
|
||||
"bundle": "data_Himegari_windows_x86_64",
|
||||
"bundle": "data_OME_windows_x86_64",
|
||||
"machines": {
|
||||
name: "AMD64"
|
||||
for name in (verify_windows_native.SHIM, *verify_windows_native.RUNTIME_DLLS)
|
||||
@@ -109,7 +109,7 @@ def create_artifacts(root: Path) -> tuple[Path, Path, Path]:
|
||||
windows.mkdir()
|
||||
|
||||
linux_info = build_info("linux-x64")
|
||||
linux_ledger = f"{'0' * 64} Himegari.x86_64\n".encode()
|
||||
linux_ledger = f"{'0' * 64} OME\n".encode()
|
||||
linux_archive = linux / publish_gitea_release.LINUX_ARCHIVE
|
||||
with tarfile.open(linux_archive, "w:gz") as archive:
|
||||
add_tar_bytes(
|
||||
@@ -130,7 +130,7 @@ def create_artifacts(root: Path) -> tuple[Path, Path, Path]:
|
||||
write_checksum(linux, linux_archive)
|
||||
|
||||
windows_info = build_info("win-x64")
|
||||
windows_ledger = f"{'1' * 64} Himegari.exe\n".encode()
|
||||
windows_ledger = f"{'1' * 64} OME.exe\n".encode()
|
||||
verification = windows_verification()
|
||||
windows_archive = windows / publish_gitea_release.WINDOWS_ARCHIVE
|
||||
with zipfile.ZipFile(windows_archive, "w", compression=zipfile.ZIP_DEFLATED) as archive:
|
||||
@@ -156,6 +156,7 @@ class PublishGiteaReleaseTests(unittest.TestCase):
|
||||
self.assertEqual(17, result["id"])
|
||||
self.assertEqual(TAG, api.created_payload["tag_name"])
|
||||
self.assertEqual(TARGET, api.created_payload["target_commitish"])
|
||||
self.assertEqual(f"Open Maid Engine {TAG}", api.created_payload["name"])
|
||||
self.assertIn("Windows archive", api.created_payload["body"])
|
||||
self.assertEqual(
|
||||
publish_gitea_release.EXPECTED_RELEASE_ASSETS,
|
||||
|
||||
@@ -8,6 +8,13 @@ from pathlib import Path
|
||||
|
||||
REPO = Path(__file__).resolve().parent.parent
|
||||
WORKFLOW = REPO / ".gitea/workflows/linux-release-build.yml"
|
||||
EXPORT_PRESETS = REPO / "godot/export_presets.cfg"
|
||||
GODOT_PROJECT = REPO / "godot/project.godot"
|
||||
MANAGED_PROJECT = REPO / "godot/OME.csproj"
|
||||
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"
|
||||
|
||||
|
||||
def job(text: str, name: str, next_name: str | None) -> str:
|
||||
@@ -23,6 +30,42 @@ class ReleaseWorkflowTests(unittest.TestCase):
|
||||
cls.linux = job(cls.text, "linux-release", "windows-release")
|
||||
cls.windows = job(cls.text, "windows-release", "publish-release")
|
||||
cls.publish = job(cls.text, "publish-release", None)
|
||||
cls.export_presets = EXPORT_PRESETS.read_text(encoding="utf-8")
|
||||
cls.godot_project = GODOT_PROJECT.read_text(encoding="utf-8")
|
||||
cls.managed_project = MANAGED_PROJECT.read_text(encoding="utf-8")
|
||||
cls.managed_solution = MANAGED_SOLUTION.read_text(encoding="utf-8")
|
||||
cls.linux_build = LINUX_BUILD.read_text(encoding="utf-8")
|
||||
cls.windows_build = WINDOWS_BUILD.read_text(encoding="utf-8")
|
||||
cls.windows_hosted_export = WINDOWS_HOSTED_EXPORT.read_text(encoding="utf-8")
|
||||
|
||||
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)
|
||||
self.assertIn('project/assembly_name="OME"', self.godot_project)
|
||||
self.assertIn('LogicalName="OME.Runtime.opcodes.json"', self.managed_project)
|
||||
self.assertIn('= "OME", "OME.csproj"', self.managed_solution)
|
||||
self.assertIn("'OME.sln'", self.windows_hosted_export)
|
||||
self.assertFalse((REPO / "godot/Himegari.csproj").exists())
|
||||
self.assertFalse((REPO / "godot/Himegari.sln").exists())
|
||||
active_surfaces = "\n".join(
|
||||
(
|
||||
self.text,
|
||||
self.export_presets,
|
||||
self.godot_project,
|
||||
self.linux_build,
|
||||
self.windows_build,
|
||||
self.windows_hosted_export,
|
||||
)
|
||||
)
|
||||
for legacy_name in (
|
||||
"Himegari.exe",
|
||||
"Himegari.x86_64",
|
||||
"Himegari.dll",
|
||||
"Himegari.csproj",
|
||||
"Himegari.sln",
|
||||
"OpenMaidEngine-Himegari",
|
||||
):
|
||||
self.assertNotIn(legacy_name, active_surfaces)
|
||||
|
||||
def test_build_jobs_are_linux_hosted_read_only_and_target_separate(self) -> None:
|
||||
self.assertRegex(self.text, r"(?m)^permissions:\n contents: read$")
|
||||
@@ -49,8 +92,8 @@ class ReleaseWorkflowTests(unittest.TestCase):
|
||||
|
||||
def test_windows_artifact_is_archive_plus_structural_evidence(self) -> None:
|
||||
for name in (
|
||||
"OpenMaidEngine-Himegari-windows-x64.zip",
|
||||
"OpenMaidEngine-Himegari-windows-x64.zip.sha256",
|
||||
"OME-windows-x64.zip",
|
||||
"OME-windows-x64.zip.sha256",
|
||||
"BUILD-INFO.json",
|
||||
"SHA256SUMS",
|
||||
"WINDOWS-VERIFICATION.json",
|
||||
@@ -66,8 +109,8 @@ class ReleaseWorkflowTests(unittest.TestCase):
|
||||
r"(?m)^ needs:\n - linux-release\n - windows-release$",
|
||||
)
|
||||
self.assertIn("releases: write", self.publish)
|
||||
self.assertIn("OpenMaidEngine-Himegari-linux-x64-${{ gitea.sha }}", self.publish)
|
||||
self.assertIn("OpenMaidEngine-Himegari-windows-x64-${{ gitea.sha }}", self.publish)
|
||||
self.assertIn("OME-linux-x64-${{ gitea.sha }}", self.publish)
|
||||
self.assertIn("OME-windows-x64-${{ gitea.sha }}", self.publish)
|
||||
self.assertIn("path: build/release-assets/linux", self.publish)
|
||||
self.assertIn("path: build/release-assets/windows", self.publish)
|
||||
self.assertIn("--linux-artifact-directory build/release-assets/linux", self.publish)
|
||||
|
||||
@@ -216,7 +216,7 @@ def build_gate_plan(
|
||||
Gate(
|
||||
"godot-build",
|
||||
"Godot C# build",
|
||||
("dotnet", "build", "godot/Himegari.csproj", "--nologo", "--verbosity", "minimal"),
|
||||
("dotnet", "build", "godot/OME.csproj", "--nologo", "--verbosity", "minimal"),
|
||||
300,
|
||||
),
|
||||
Gate(
|
||||
|
||||
Reference in New Issue
Block a user