refactor(windows): publish Velopack updates through Gitea Releases

This commit is contained in:
lingjhf committed 2026-10-06 12:56:31 +08:00
1 parent 826745b407
commit 1ef8edc8bc
17 files changed
+519 -87

No files matched your search

+18
View File
@@ -0,0 +1,18 @@
"""Windows update version ordering, independent of Flutter package resolution."""
import re
def update_version(display_version, build):
version = display_version + '-build.' + str(int(build))
numeric_version(version)
return version
def numeric_version(version):
number = r'(0|[1-9]\d*)'
match = re.fullmatch(rf'{number}\.{number}\.{number}(?:-build\.{number})?', version)
if not match:
raise ValueError('Windows update versions must use major.minor.patch-build.number')
major, minor, patch, build = match.groups()
# SemVer +build metadata does not participate in precedence.
return (int(major), int(minor), int(patch), int(build is None), int(build or 0))