@@ -58,44 +58,33 @@ jobs:
5858 echo "Found platforms: $PLATFORMS_JSON"
5959 echo "platforms=$PLATFORMS_JSON" >> $GITHUB_OUTPUT
6060
61- - name : Prepare Node uploader
62- run : |
63- npm init -y
64- npm install @actions/artifact@2.4.2
65-
66- - name : Write uploader script
67- run : |
68- cat > upload_artifacts.js <<'JS'
69- const fs = require('fs');
70- const path = require('path');
71- const artifact = require('@actions/artifact');
61+ - name : Upload all platform directories as a single artifact
62+ if : always()
63+ uses : actions/upload-artifact@v4
64+ with :
65+ name : aml-all
66+ path : artifacts
7267
73- async function main() {
74- const client = artifact.create();
75- const platforms = JSON.parse(process.env.PLATFORMS_JSON || '[]');
76- if (!platforms.length) {
77- console.log('No platforms to upload');
78- return;
79- }
80- for (const p of platforms) {
81- const dir = path.join('artifacts', p);
82- if (!fs.existsSync(dir)) {
83- console.log(`Skipping ${p}, directory not found : ${dir}`);
84- continue;
85- }
86- const files = fs.readdirSync(dir).map(f => path.join(dir, f));
87- console.log(`Uploading artifact ${p} with files:`, files);
88- // uploadArtifact(name, files, rootDirectory)
89- await client.uploadArtifact(p, files, dir);
90- }
91- }
68+ upload :
69+ name : Upload platform artifacts
70+ needs : build
71+ runs-on : ubuntu-latest
72+ strategy :
73+ fail-fast : false
74+ matrix :
75+ platform : ${{ fromJson(needs.build.outputs.platforms) }}
76+ steps :
77+ - name : Checkout repository
78+ uses : actions/checkout@v4
9279
93- main().catch(err => { console.error(err); process.exit(1); });
94- JS
80+ - name : Download aml-all artifact
81+ uses : actions/download-artifact@v4
82+ with :
83+ name : aml-all
84+ path : ./
9585
96- - name : Upload per-platform artifacts (single job, sequential)
97- env :
98- PLATFORMS_JSON : ${{ steps.prepare.outputs.platforms }}
99- GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
100- run : |
101- node upload_artifacts.js
86+ - name : Upload per-platform artifact
87+ uses : actions/upload-artifact@v4
88+ with :
89+ name : ${{ matrix.platform }}
90+ path : artifacts/${{ matrix.platform }}
0 commit comments