@@ -95,13 +95,14 @@ jobs:
9595 print(f"Found version in release name: {release_name_version}")
9696
9797 # Extract assets
98- # Special handling for composer (uses .phar files) and xlight (version in release name)
98+ # Special handling for composer (uses .phar files), xlight (version in release name), and git (files start with "portable" )
9999 assets = []
100100 for asset in release_data.get('assets', []):
101101 filename = asset['name']
102102
103103 # For composer, accept any .phar file (doesn't need to start with "composer")
104104 # For xlight, accept xlight-x64.zip (version comes from release name)
105+ # For git, files start with "portable" instead of "git"
105106 # For other modules, file must start with module name
106107 if module_name == 'composer':
107108 if filename.endswith('.phar'):
@@ -138,6 +139,33 @@ jobs:
138139 print(f"ERROR: Could not extract version for xlight from release name")
139140 print(f"Release name: {release_data.get('name', 'N/A')}")
140141 exit(1)
142+ elif module_name == 'git':
143+ # For git, files start with "portable" instead of "git"
144+ if filename.lower().startswith('portable') and (filename.endswith('.7z') or filename.endswith('.exe') or filename.endswith('.zip')):
145+ download_url = asset['browser_download_url']
146+
147+ # Try to extract version from filename first, then fall back to release name
148+ version_match = re.search(r'(\d+(?:\.\d+)+)', filename)
149+ if version_match:
150+ ver = version_match.group(1)
151+ assets.append({
152+ 'version': ver,
153+ 'url': download_url,
154+ 'filename': filename
155+ })
156+ print(f"Found: {filename} -> Version: {ver} (from filename)")
157+ elif release_name_version:
158+ ver = release_name_version
159+ assets.append({
160+ 'version': ver,
161+ 'url': download_url,
162+ 'filename': filename
163+ })
164+ print(f"Found: {filename} -> Version: {ver} (from release name)")
165+ else:
166+ print(f"ERROR: Could not extract version for git from release name or filename: {filename}")
167+ print(f"Release name: {release_data.get('name', 'N/A')}")
168+ exit(1)
141169 elif filename.lower().startswith(module_name):
142170 # Standard modules use .7z, .exe, or .zip and must start with module name (case-insensitive)
143171 if filename.endswith('.7z') or filename.endswith('.exe') or filename.endswith('.zip'):
@@ -189,6 +217,10 @@ jobs:
189217 elif module_name == 'xlight':
190218 print(f"No xlight-x64.zip asset found in release")
191219 print(f"Available assets: {[a['name'] for a in release_data.get('assets', [])]}")
220+ elif module_name == 'git':
221+ print(f"No valid assets found in release")
222+ print(f"Expected: .7z, .exe, or .zip files starting with 'portable'")
223+ print(f"Available assets: {[a['name'] for a in release_data.get('assets', [])]}")
192224 else:
193225 print(f"No .7z, .exe, or .zip assets found starting with '{module_name}' in release")
194226 print(f"Available assets: {[a['name'] for a in release_data.get('assets', [])]}")
0 commit comments