@@ -109,30 +109,8 @@ def release_metadata(repository, version, directory, refresh=False):
109109 return json .loads (path .read_text ())
110110
111111
112- def version_key (version ):
113- """Orders semantic versions. A release comes after its prereleases."""
114- match = re .fullmatch (r'v?(\d+)\.(\d+)(?:\.(\d+))?(?:-([0-9A-Za-z.-]+))?(?:\+[0-9A-Za-z.-]+)?' , version )
115- if match is None :
116- return None
117- major , minor , patch , prerelease = match .groups ()
118- parts = [(0 , int (part ), '' ) if part .isdigit () else (1 , 0 , part ) for part in (prerelease or '' ).split ('.' ) if part ]
119- return (int (major ), int (minor ), int (patch or 0 )), not prerelease , parts
120-
121-
122- def latest_patches (versions ):
123- """Keeps the highest patch version of each major and minor version, in the input order.
124- Labels that are not semantic versions are kept."""
125- latest = {}
126- for version in versions :
127- key = version_key (version )
128- if key is not None and (key [0 ][:2 ] not in latest or key > version_key (latest [key [0 ][:2 ]])):
129- latest [key [0 ][:2 ]] = version
130- return [version for version in versions if version_key (version ) is None or latest [version_key (version )[0 ][:2 ]] == version ]
131-
132-
133112def published_releases (repository , work ):
134- """Returns the published releases that include both XCFrameworks, oldest first. Only the
135- highest patch version of each minor version is kept."""
113+ """Returns the published releases that include both XCFrameworks, oldest first."""
136114 releases = json .loads (gh ('release' , 'list' , '--repo' , repository , '--limit' , '1000' ,
137115 '--exclude-drafts' , '--json' , 'tagName,publishedAt' ))
138116 result = []
@@ -145,7 +123,7 @@ def published_releases(repository, work):
145123 names = {asset ['name' ] for asset in release_metadata (repository , version , work / 'releases' / version , refresh = True )['assets' ]}
146124 if all (name in names for name in wanted ):
147125 result .append (version )
148- return latest_patches ( result )
126+ return result
149127
150128
151129def asset_digests (repository , version , work ):
@@ -365,7 +343,7 @@ def add_site_options(command):
365343 releases = collect_command .add_mutually_exclusive_group (required = True )
366344 releases .add_argument ('--release' , action = 'append' , help = 'Release tag. Repeat for more releases.' )
367345 releases .add_argument ('--all-releases' , action = 'store_true' ,
368- help = 'Use the highest patch version of each minor version among the published releases that include both XCFrameworks.' )
346+ help = 'Use every published release that includes both XCFrameworks.' )
369347 collect_command .add_argument ('--xcode' , action = 'append' , required = True , type = pathlib .Path ,
370348 help = 'Xcode application that supplies the baseline SDK. Repeat for more baselines.' )
371349 collect_command .add_argument ('--target' , action = 'append' , choices = sorted (TARGETS ),
0 commit comments