Skip to content

Commit 7f945fc

Browse files
committed
handle multiple artifact uploads
1 parent a72ffaf commit 7f945fc

3 files changed

Lines changed: 33 additions & 26 deletions

File tree

.github/workflows/ci.yml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -872,18 +872,28 @@ jobs:
872872
otool -L ./haxe
873873
otool -L ./haxelib
874874
875+
- name: Upload Ecso
876+
uses: actions/upload-artifact@v4
877+
with:
878+
name: ecso-mac
879+
path: plugins/ecso/**/*.cmxs
880+
if-no-files-found: error
881+
882+
875883
- name: Upload artifact (x64)
876884
if: runner.arch == 'X64'
877885
uses: actions/upload-artifact@v4
878886
with:
879887
name: macX64Binaries
888+
retention-days: 1
880889
path: out
881890

882891
- name: Upload artifact (arm)
883892
if: runner.arch == 'ARM64'
884893
uses: actions/upload-artifact@v4
885894
with:
886895
name: macArmBinaries
896+
retention-days: 1
887897
path: out
888898

889899

.github/workflows/release.yml

Lines changed: 10 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -853,19 +853,13 @@ jobs:
853853
otool -L ./plugins/ecso/cmxs/hx-4.3.7/Mac/plugin.cmxs
854854
ls -l out
855855
856-
- name: Upload artifact (x64)
857-
if: runner.arch == 'X64'
858-
uses: actions/upload-artifact@v4
859-
with:
860-
name: macX64Binaries
861-
path: out
862-
863-
- name: Upload artifact (arm)
864-
if: runner.arch == 'ARM64'
856+
- name: Upload Ecso
865857
uses: actions/upload-artifact@v4
866858
with:
867-
name: macArmBinaries
868-
path: out
859+
name: ecso-mac-x64
860+
path: plugins/ecso/**/*.cmxs
861+
if-no-files-found: error
862+
869863

870864

871865
mac-x64-4-3-7-test:
@@ -1073,19 +1067,13 @@ jobs:
10731067
otool -L ./plugins/ecso/cmxs/hx-4.3.7/Mac/plugin.cmxs
10741068
ls -l out
10751069
1076-
- name: Upload artifact (x64)
1077-
if: runner.arch == 'X64'
1078-
uses: actions/upload-artifact@v4
1079-
with:
1080-
name: macX64Binaries
1081-
path: out
1082-
1083-
- name: Upload artifact (arm)
1084-
if: runner.arch == 'ARM64'
1070+
- name: Upload Ecso
10851071
uses: actions/upload-artifact@v4
10861072
with:
1087-
name: macArmBinaries
1088-
path: out
1073+
name: ecso-mac-arm64
1074+
path: plugins/ecso/**/*.cmxs
1075+
if-no-files-found: error
1076+
10891077

10901078

10911079
mac-arm64-4-3-7-test:

extra/github-actions/Main.hx

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,8 @@ typedef Job = {
3838
@:nullSafety
3939
class 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]+?(?=\sname:)\sname:\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]+?(?=\sname:)\sname:\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]+?(?=\sname:)\sname:\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

Comments
 (0)