Lowercase update-feed nupkgs in release assets
MediaHive-*-full.nupkg sorted between the capitalized Setup/AppImage user downloads on the Gitea release page. Renamed to mediahive-* they group with the wheel/sdist below the downloads; feed manifests (RELEASES, releases.*.json, assets.*.json) are patched to match.
This commit is contained in:
@@ -390,9 +390,32 @@ def build_velopack(version: str) -> Path:
|
|||||||
)
|
)
|
||||||
artifact.unlink(missing_ok=True)
|
artifact.unlink(missing_ok=True)
|
||||||
setup.rename(artifact)
|
setup.rename(artifact)
|
||||||
|
rename_feed_packages(releases_dir)
|
||||||
return artifact
|
return artifact
|
||||||
|
|
||||||
|
|
||||||
|
def rename_feed_packages(releases_dir: Path) -> None:
|
||||||
|
"""Lowercase the update-feed nupkgs in place.
|
||||||
|
|
||||||
|
Gitea sorts release assets with capitals first: MediaHive-*-full.nupkg
|
||||||
|
listed right between the Setup/AppImage downloads invites confusion.
|
||||||
|
As mediahive-*-full.nupkg they group with the wheel/sdist instead.
|
||||||
|
The feed manifests reference the filename, so patch those too.
|
||||||
|
"""
|
||||||
|
manifests = [
|
||||||
|
p
|
||||||
|
for pattern in ("RELEASES", "releases.*.json", "assets.*.json")
|
||||||
|
for p in releases_dir.glob(pattern)
|
||||||
|
]
|
||||||
|
for nupkg in releases_dir.glob("MediaHive-*-full.nupkg"):
|
||||||
|
new_name = "mediahive-" + nupkg.name.removeprefix("MediaHive-")
|
||||||
|
for manifest in manifests:
|
||||||
|
text = manifest.read_text()
|
||||||
|
if nupkg.name in text:
|
||||||
|
manifest.write_text(text.replace(nupkg.name, new_name))
|
||||||
|
nupkg.rename(nupkg.with_name(new_name))
|
||||||
|
|
||||||
|
|
||||||
def force_macos_user_install(pkg: Path) -> None:
|
def force_macos_user_install(pkg: Path) -> None:
|
||||||
"""Restrict the Velopack-generated pkg to per-user installs (~/Applications).
|
"""Restrict the Velopack-generated pkg to per-user installs (~/Applications).
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user