Skip to content

Commit b753755

Browse files
feat(ci): check jco transpile size before release
1 parent 9301c05 commit b753755

1 file changed

Lines changed: 17 additions & 0 deletions

File tree

.github/workflows/release.yml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -370,6 +370,23 @@ jobs:
370370
with:
371371
version: 11
372372

373+
# NOTE: jco-transpile packed should be ~2.1MB
374+
- name: Test jco-transpile package size
375+
if: ${{ needs.meta.outputs.project == 'jco-transpile' }}
376+
shell: bash
377+
env:
378+
ARTIFACT_NAME: ${{ needs.meta.outputs.artifact-name }}
379+
GH_WORKSPACE: ${{ github.workspace }}
380+
run: |
381+
export FILE="$GH_WORKSPACE/gh-artifacts/$ARTIFACT_NAME";
382+
SIZE=$(wc -c < "$FILE");
383+
MAX_SIZE=$((3 * 1024 * 1024));
384+
echo -e "::info:: jco-transpile package size ${SIZE} bytes;
385+
if (( SIZE > MAX_SIZE )); then
386+
echo "::error:: next jco-transpile NPM package artifacts should less than 3MB";
387+
exit 1;
388+
fi
389+
373390
- name: Test built jco NPM package
374391
if: ${{ needs.meta.outputs.project == 'jco' }}
375392
shell: bash

0 commit comments

Comments
 (0)