-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
60 lines (58 loc) · 1.83 KB
/
publishable.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
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.
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
flutter pub get
fi
- run: dart pub publish --dry-run
working-directory: ${{ matrix.directory }}