@@ -38,8 +38,8 @@ typedef Job = {
3838@:nullSafety
3939class Main {
4040 static final matchHaxeCheckout = ~/ ([\r\n ] \s * )-\s * uses\s * :\s * (actions\/ checkout@[A-Za-z0-9 . ] + )\s * [\r\n ] (. | \r | \n )+? (?=(\r | \n )\s * -)/ gm ;
41- static final matchXmldocTasks = ~/ ([\r\n ] \s * )-\s * name:[\w\s ] + xmldoc[\w\s ] + \s * :\s * [\w\W ] +? (?=\n\n | \n\s * -)/ gm ;
42- static final matchUploadArtifact = ~/ ([\r\n ] \s * )-\s * name:[\w\s ] + \s * :\s * (actions\/ upload-artifact@[A-Za-z0-9 . ] + )\s * [\w\W\r\n ] +? (?=\s name:)\s name:\s ([\w ${}. |&'=()] + )[\w\W ] +? (?=\n\n | \n\s * -)/ gm ;
41+ static final matchXmldocTasks = ~/ ([\r\n ] \s * )-\s * name:[\w\s () ] + xmldoc[\w\s ] + \s * :\s * [\w\W ] +? (?=\n\n | \n\s * -)/ gm ;
42+ static final matchUploadArtifact = ~/ ([\r\n ] \s * )-\s * name:[\w\s (): . ='|& ] + \s * :\s * (actions\/ upload-artifact@[A-Za-z0-9 . ] + )\s * [\w\W\r\n ] +? (?=\s name:)\s name:\s ([\w ${}. |&'=()] + )[\w\W ] +? (?=\n\n | \n\s * -)/ gm ;
4343 static final matchDownloadArtifact = ~/ ([\r\n ] \s * )-\s * uses\s * :\s * (actions\/ download-artifact@[A-Za-z0-9 . ] + )\s * [\w\W\r\n ] +? (?=\s name:)\s name:\s ([\w ${}. |&'=()] + )/ gm ;
4444 static final matchHaxeTests = ~/ ([\r\n ] \s * )-\s * name: (Test[\w ()-] * )\s * [\n ][\w\W ] +? (?=haxe)(haxe RunCi\. hxml)[\w\W ] +? (?=working-directory:)(working-directory:\s * ([\w ${}. \/ ] + ))[\w\W ] +? (?=\n\n | \n\s * -)/ gm ;
4545 static final matchHaxeTargets = ~/ [\r\n\s ] target:\s * \[ ([\w ,\s '"] * )\] / gm ;
@@ -339,6 +339,7 @@ class Main {
339339 });
340340
341341 // Upload artifact
342+ var ecsoUploaded = false ;
342343 script = map (matchUploadArtifact , script , function (reg : EReg ) {
343344 var matched = reg .matched (0 );
344345 if (matched .contains (" xmldoc" ))
@@ -348,14 +349,22 @@ class Main {
348349 var name = reg .matched (3 );
349350 var tab = head .substr (head .lastIndexOf (' \n ' ) + 1 );
350351
351- var uploadEcso = File .getContent (' ./upload-cmxs.yml' ).replace (' ::ARTIFACT_NAME::' , " ecso-" + manifest .name );
352352 var uploadHaxe = if (manifest .haxeDownload == null ) {
353353 matched .replace (name , ' $name \n $tab retention-days: 1' );
354354 } else {
355355 ' ' ;
356356 };
357357
358- return align (uploadEcso , head ) + uploadHaxe ;
358+ // make sure to upload ecso only once
359+ var uploadEcso = if (! ecsoUploaded ) {
360+ ecsoUploaded = true ;
361+ var uploadEcso = File .getContent (' ./upload-cmxs.yml' ).replace (' ::ARTIFACT_NAME::' , " ecso-" + manifest .name );
362+ align (uploadEcso , head );
363+ } else {
364+ ' ' ;
365+ }
366+
367+ return uploadEcso + uploadHaxe ;
359368 });
360369
361370 // Download artifact
0 commit comments