From 9d3cbc46ef5b4c3faa0cb409957837d51b24d704 Mon Sep 17 00:00:00 2001 From: CSY-ModelCloud Date: Fri, 24 Oct 2025 09:16:43 +0800 Subject: [PATCH 1/4] [CI] check wheel size Add a size check for wheel files before twine installation. --- .github/workflows/release.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index e49b25425..98cee7561 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -329,6 +329,9 @@ jobs: ls -ahl dist whl=$(ls -t dist/*.whl | head -n 1 | xargs basename) echo "WHL_NAME=$whl" >> $GITHUB_ENV + + [ $(stat -c%s "$whl") -lt 104857600 ] && echo "wheel size < 100M" && exit 1 || echo "$whl size check passed." + if [ "${{ matrix.python }}" != "313t" ]; then # twine doesn't support python 3.13 yet pip install twine twine check dist/$whl From 5ed2c435a6ea60ed477bc7531d274eb58e7af822 Mon Sep 17 00:00:00 2001 From: CSY-ModelCloud Date: Fri, 24 Oct 2025 09:18:00 +0800 Subject: [PATCH 2/4] [CI] check wheel size for unit test --- .github/workflows/unit_tests.yml | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/.github/workflows/unit_tests.yml b/.github/workflows/unit_tests.yml index dfc745ed3..430590351 100644 --- a/.github/workflows/unit_tests.yml +++ b/.github/workflows/unit_tests.yml @@ -314,19 +314,19 @@ jobs: python setup.py bdist_wheel echo "::endgroup::" - # - name: Test install - # if: github.event.inputs.artifact_id == '' && !cancelled() - # run: | - # ls -ahl dist - # whl=$(ls -t dist/*.whl | head -n 1 | xargs basename) - # sha256=$(sha256sum dist/$whl) - # echo "hash=$sha256" - - # echo "WHL_HASH=$sha256" >> $GITHUB_ENV - # echo "WHL_NAME=$whl" >> $GITHUB_ENV - - # twine check dist/$whl - # uv pip install dist/$whl + - name: check wheel + if: github.event.inputs.artifact_id == '' && !cancelled() + run: | + ls -ahl dist + whl=$(ls -t dist/*.whl | head -n 1 | xargs basename) + sha256=$(sha256sum dist/$whl) + echo "hash=$sha256" + + echo "WHL_HASH=$sha256" >> $GITHUB_ENV + echo "WHL_NAME=$whl" >> $GITHUB_ENV + + twine check dist/$whl + [ $(stat -c%s "$whl") -lt 104857600 ] && echo "wheel size < 100M" && exit 1 || echo "$whl size check passed." - name: Upload wheel to local if: github.event.inputs.artifact_id == '' && !cancelled() From c744effc1ac2f21886a455fba716709ed1e40bb2 Mon Sep 17 00:00:00 2001 From: CSY-ModelCloud Date: Fri, 24 Oct 2025 09:21:51 +0800 Subject: [PATCH 3/4] fix path --- .github/workflows/release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 98cee7561..3956353b9 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -330,7 +330,7 @@ jobs: whl=$(ls -t dist/*.whl | head -n 1 | xargs basename) echo "WHL_NAME=$whl" >> $GITHUB_ENV - [ $(stat -c%s "$whl") -lt 104857600 ] && echo "wheel size < 100M" && exit 1 || echo "$whl size check passed." + [ $(stat -c%s "dist/$whl") -lt 104857600 ] && echo "wheel size < 100M" && exit 1 || echo "$whl size check passed." if [ "${{ matrix.python }}" != "313t" ]; then # twine doesn't support python 3.13 yet pip install twine From 87a3e2928c634c99046fe236ff7af185eba07ad1 Mon Sep 17 00:00:00 2001 From: CSY-ModelCloud Date: Fri, 24 Oct 2025 09:22:09 +0800 Subject: [PATCH 4/4] fix path --- .github/workflows/unit_tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/unit_tests.yml b/.github/workflows/unit_tests.yml index 430590351..6dac2f57e 100644 --- a/.github/workflows/unit_tests.yml +++ b/.github/workflows/unit_tests.yml @@ -326,7 +326,7 @@ jobs: echo "WHL_NAME=$whl" >> $GITHUB_ENV twine check dist/$whl - [ $(stat -c%s "$whl") -lt 104857600 ] && echo "wheel size < 100M" && exit 1 || echo "$whl size check passed." + [ $(stat -c%s "dist/$whl") -lt 104857600 ] && echo "wheel size < 100M" && exit 1 || echo "$whl size check passed." - name: Upload wheel to local if: github.event.inputs.artifact_id == '' && !cancelled()