@@ -39,16 +39,17 @@ def get_file_diff() -> List[str]:
3939 return added_lines
4040
4141
42- def parse_filename (added_lines : List [str ]) -> Optional [str ]:
43- """Parse filename from added lines"""
42+ def parse_filenames (added_lines : List [str ]) -> List [str ]:
43+ """Parse filenames from added lines"""
44+ filenames = []
4445 for line in added_lines :
4546 if '"filename":' in line :
4647 try :
4748 filename = line .split (":" )[1 ].strip ().strip ('",' )
48- return filename
49+ filenames . append ( filename )
4950 except IndexError :
5051 print (f"Error parsing line: { line } " )
51- return None
52+ return filenames
5253
5354
5455def get_extension_info (filename : str ) -> Optional [Dict ]:
@@ -220,63 +221,76 @@ def main():
220221 print ("No changes found in index.json" )
221222 return
222223
223- # Parse filename from added lines
224- filename = parse_filename (added_lines )
225- if not filename :
226- print ("No filename found in changes" )
224+ # Parse filenames from added lines
225+ filenames = parse_filenames (added_lines )
226+ if not filenames :
227+ print ("No filenames found in changes" )
227228 return
228229
229- # Get extension info from index.json
230- extension_info = get_extension_info (filename )
231- if not extension_info :
232- print ("Could not get extension information from index.json" )
233- return
234-
235- try :
236- tag_name , release_title , version = generate_tag_and_title (filename )
237-
238- extension_name = re .match (r"^(.*?)[-_]\d+\.\d+\.\d+" , filename ).group (1 )
239- print ("Getting history notes from source code..." )
240- history_note = get_history_note_from_source (version , extension_name )
241-
242- if "No history notes found" in history_note :
243- print ("No history notes found in source code, trying wheel..." )
244- history_note = get_history_note (extension_info ["downloadUrl" ], version )
230+ print (f"Found { len (filenames )} files to process" )
231+
232+ # Process each filename
233+ for filename in filenames :
234+ print (f"\n Processing { filename } ..." )
235+
236+ # Get extension info from index.json
237+ extension_info = get_extension_info (filename )
238+ if not extension_info :
239+ print (f"Could not get extension information for { filename } , skipping..." )
240+ continue
245241
242+ try :
243+ tag_name , release_title , version = generate_tag_and_title (filename )
244+
245+ # Check if tag already exists
246+ if check_tag_exists (tag_url , tag_name , headers ):
247+ print (f"Tag { tag_name } already exists, skipping..." )
248+ continue
249+
250+ # Try to get history notes from source code first
251+ print (f"Getting history notes from source code..." )
252+ extension_name = re .match (r"^(.*?)[-_]\d+\.\d+\.\d+" , filename ).group (1 )
253+ history_note = get_history_note_from_source (version , extension_name )
254+
255+ # If no notes found in source code, try wheel package
246256 if "No history notes found" in history_note :
247- print ("No history notes found in wheel, using default release note..." )
248- history_note = f"Release { extension_name } { version } "
249-
250- # Generate release body
251- release_body = generate_release_body (history_note , extension_info ["sha256Digest" ], filename )
252-
253- commit_sha = subprocess .check_output (
254- ["git" , "rev-parse" , "HEAD" ],
255- text = True
256- ).strip ()
257-
258- if check_tag_exists (tag_url , tag_name , headers ):
259- print (f"Tag { tag_name } already exists, skipping..." )
260- return
261-
262- release_data = {
263- "tag_name" : tag_name ,
264- "target_commitish" : commit_sha ,
265- "name" : release_title ,
266- "body" : release_body
267- }
268-
269- print ("\n Creating release with data:" )
270- print (f"Tag name: { tag_name } " )
271- print (f"Release title: { release_title } " )
272- print (f"Target commit: { commit_sha } " )
273- print (f"Body preview: { release_body [:200 ]} ..." )
274-
275- create_release (release_url , release_data , headers , extension_info ["downloadUrl" ])
276-
277- except ValueError as e :
278- print (f"Error generating tag for filename { filename } : { e } " )
279- return
257+ print (f"No history notes found in source code, trying wheel package..." )
258+ history_note = get_history_note (extension_info ["downloadUrl" ], version )
259+
260+ # If still no notes found, use default release note
261+ if "No history notes found" in history_note :
262+ print (f"No history notes found in wheel package, using default release note..." )
263+ history_note = f"Release { extension_name } { version } "
264+
265+ # Generate release body
266+ release_body = generate_release_body (history_note , extension_info ["sha256Digest" ], filename )
267+
268+ commit_sha = subprocess .check_output (
269+ ["git" , "rev-parse" , "HEAD" ],
270+ text = True
271+ ).strip ()
272+
273+ release_data = {
274+ "tag_name" : tag_name ,
275+ "target_commitish" : commit_sha ,
276+ "name" : release_title ,
277+ "body" : release_body
278+ }
279+
280+ print (f"\n Creating release with data:" )
281+ print (f"Tag name: { tag_name } " )
282+ print (f"Release title: { release_title } " )
283+ print (f"Target commit: { commit_sha } " )
284+ print (f"Body preview: { release_body [:200 ]} ..." )
285+
286+ create_release (release_url , release_data , headers , extension_info ["downloadUrl" ])
287+
288+ except ValueError as e :
289+ print (f"Error generating tag for filename { filename } : { e } " )
290+ continue
291+ except Exception as e :
292+ print (f"Unexpected error processing { filename } : { e } " )
293+ continue
280294
281295 except Exception as e :
282296 print (f"Unexpected error: { e } " )
0 commit comments