Skip to content

👷 Add README.md & CHANGELOG.md size check for publishable tests #563

👷 Add README.md & CHANGELOG.md size check for publishable tests

👷 Add README.md & CHANGELOG.md size check for publishable tests #563

Workflow file for this run

name: Publishable
on:
push:
branches:
- main
- '6.0.0'
paths:
- "**.md"
- "**.yaml"
- "**.yml"
pull_request:
branches:
- main
- '6.0.0'
paths:
- "**.md"
- "**.yaml"
- "**.yml"
jobs:
publish-dry-run:
name: Publish dry-run with packages
runs-on: ubuntu-latest
strategy:
matrix:
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.
readme_size=$(stat -c%s README.md)
changelog_size=$(stat -c%s CHANGELOG.md)
if [ $readme_size -gt $limit_size ]; then
echo "README.md exceeded the maximum size: $readme_size > $limit_size."
exit 1
fi
if [ $changelog_size -gt $limit_size ]; then
echo "CHANGELOG.md exceeded the maximum size: $changelog_size > $limit_size."
exit 1
fi
- uses: subosito/flutter-action@v2
- run: |
if grep -q "flutter:" "${{ matrix.directory }}/pubspec.yaml"; then
flutter pub get
fi
- run: dart pub publish --dry-run
working-directory: ${{ matrix.directory }}