From 4493f1ec28342d49f0ccd0ffdb228dd00d29523f Mon Sep 17 00:00:00 2001 From: Alex Li Date: Fri, 22 Sep 2023 13:58:42 +0800 Subject: [PATCH] =?UTF-8?q?=F0=9F=91=B7=20Add=20`README.md`=20&=20`CHANGEL?= =?UTF-8?q?OG.md`=20size=20check=20for=20publishable=20tests=20(#1977)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Inspired by https://github.com/dart-lang/pub-dev/issues/6012. ### New Pull Request Checklist - [x] I have read the [Documentation](https://pub.dev/documentation/dio/latest/) - [x] I have searched for a similar pull request in the [project](https://github.com/cfug/dio/pulls) and found none - [x] I have updated this branch with the latest `main` branch to avoid conflicts (via merge from master or rebase) - [ ] I have added the required tests to prove the fix/feature I'm adding - [ ] I have updated the documentation (if necessary) - [x] I have run the tests without failures - [ ] I have updated the `CHANGELOG.md` in the corresponding package --- .github/workflows/publishable.yml | 24 ++++++++++++++++++++++++ dio/CHANGELOG.md | 2 +- 2 files changed, 25 insertions(+), 1 deletion(-) diff --git a/.github/workflows/publishable.yml b/.github/workflows/publishable.yml index 95ed42c52..1de8313a8 100644 --- a/.github/workflows/publishable.yml +++ b/.github/workflows/publishable.yml @@ -27,6 +27,30 @@ jobs: directory: ["dio", "plugins/cookie_manager", "plugins/http2_adapter", "plugins/native_dio_adapter"] steps: - uses: actions/checkout@v3 + - name: "Check documents file size < 128kb" + working-directory: ${{ matrix.directory }} + run: | + limit_size=$(expr 128 \* 1024) # Maximum 128kb. + changelog_size=$(stat -c%s CHANGELOG.md) + echo "CHANGELOG.md file size: $changelog_size." + if [ $changelog_size -gt $limit_size ]; then + echo "CHANGELOG.md exceeded the maximum size: $changelog_size > $limit_size." + exit 1 + fi + readme_size=$(stat -c%s README.md) + echo "README.md file size: $readme_size." + if [ $readme_size -gt $limit_size ]; then + echo "README.md exceeded the maximum size: $readme_size > $limit_size." + exit 1 + fi + if [ -f README_ZH.md ]; then + readme_zh_size=$(stat -c%s README_ZH.md) + echo "README_ZH.md file size: $readme_zh_size." + if [ readme_zh_size -gt $limit_size ]; then + echo "README_ZH.md exceeded the maximum size: $readme_zh_size > $limit_size." + exit 1 + fi + fi - uses: subosito/flutter-action@v2 - run: | if grep -q "flutter:" "${{ matrix.directory }}/pubspec.yaml"; then diff --git a/dio/CHANGELOG.md b/dio/CHANGELOG.md index 39e232812..9ed27486d 100644 --- a/dio/CHANGELOG.md +++ b/dio/CHANGELOG.md @@ -376,4 +376,4 @@ First Stable version for 2.x - Initial version, created by Stagehand -[Migration Guide]: ./migration_guide.md +[Migration Guide]: doc/migration_guide.md