Skip to content

Commit 3f3f0d3

Browse files
committed
ci: add merge-artifacts script
1 parent a3330bc commit 3f3f0d3

File tree

9 files changed

+385
-50
lines changed

9 files changed

+385
-50
lines changed

.github/workflows/CI.yml

+4-32
Original file line numberDiff line numberDiff line change
@@ -258,43 +258,15 @@ jobs:
258258
pattern: build-*
259259
path: ./build-artifacts
260260

261-
- name: Create build directory
262-
shell: bash
263-
run: mkdir -p ./build
264-
265-
- name: Merge Manifests
266-
shell: python
267-
run: |
268-
import json
269-
import os
270-
import sys
271-
272-
# Get the list of files in the build-artifacts directory
273-
build_artifacts_dir = os.path.join(os.getcwd(), 'build-artifacts')
274-
manifest_files = [os.path.join(build_artifacts_dir, f) for f in os.listdir(build_artifacts_dir) if f.endswith('.json')]
275-
merged_manifest = {}
276-
for file in manifest_files:
277-
with open(file, 'r') as f:
278-
manifest = json.load(f)
279-
for key, value in manifest.items():
280-
if key not in merged_manifest:
281-
merged_manifest[key] = value
282-
else:
283-
merged_manifest[key] += value
284-
with open('./build/manifest.json', 'w') as f:
285-
json.dump(merged_manifest, f)
261+
- name: Install Dependencies
262+
run: pnpm install
286263

287264
- name: Merge Artifacts
288-
shell: bash
289265
run: |
290-
for folder in ./build-artifacts/*; do
291-
mv "$folder" ./build/
292-
done
266+
pnpm exec tsx ./script/merge-artifacts.mts
293267
294268
- name: Pack Zeromq
295-
run: |
296-
pnpm install
297-
pnpm pack
269+
run: pnpm pack
298270

299271
- name: Upload Pack
300272
uses: actions/upload-artifact@v4

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -29,3 +29,4 @@ compile_commands.json
2929

3030
/smoke-test-*
3131
/*.tgz
32+
/build-artifacts

lib/load-addon.js

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lib/load-addon.js.map

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

+5-2
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,8 @@
4444
"eslint-config-atomic": "^1.22.1",
4545
"eslint-plugin-prettier": "^5.2.1",
4646
"execa": "^9.5.2",
47-
"fs-extra": "^11.2.0",
47+
"fast-glob": "^3.3.3",
48+
"fs-extra": "^11.3.0",
4849
"gh-pages": "^6.2.0",
4950
"minify-all-cli": "^1.0.13",
5051
"mocha": "^11.0.1",
@@ -57,6 +58,7 @@
5758
"servor": "^4.0.2",
5859
"shx": "^0.3.4",
5960
"ts-node": "~10.9.2",
61+
"tsx": "^4.19.3",
6062
"typedoc": "^0.27.6",
6163
"typedoc-plugin-dt-links": "^1.1.6",
6264
"typedoc-plugin-include-example": "^2.0.2",
@@ -81,7 +83,8 @@
8183
},
8284
"onlyBuiltDependencies": [
8385
"core-js",
84-
"electron"
86+
"electron",
87+
"esbuild"
8588
]
8689
},
8790
"files": [

0 commit comments

Comments
 (0)