File tree Expand file tree Collapse file tree 2 files changed +61
-0
lines changed Expand file tree Collapse file tree 2 files changed +61
-0
lines changed Original file line number Diff line number Diff line change @@ -3,6 +3,8 @@ name: Base
3
3
on :
4
4
push :
5
5
branches : [main]
6
+ tags :
7
+ - ' *'
6
8
7
9
pull_request :
8
10
branches : [main]
38
40
run : flutter analyze
39
41
# - name: Run tests
40
42
# run: flutter test
43
+ - name : Check publish warnings
44
+ run : dart pub publish --dry-run
41
45
- name : Build example
42
46
run : |
43
47
cd example
44
48
flutter build appbundle --debug
45
49
flutter build ios --debug --no-codesign
50
+
51
+ - name : Upload coverage to Codecov
52
+ if : ${{ matrix.channel == 'stable' }}
53
+ uses : codecov/codecov-action@v3
54
+ with :
55
+ files : coverage/lcov.info
56
+ flags : unittests
57
+ name : form_builder_file_picker
58
+
59
+ deployment :
60
+ if : ${{ github.ref_type == 'tag' }}
61
+ needs : build
62
+ name : Deploy package
63
+ runs-on : ubuntu-latest
64
+
65
+ steps :
66
+ - name : Configure enviroment
67
+ uses : actions/checkout@v3
68
+ - name : Download flutter
69
+ uses : subosito/flutter-action@v2
70
+ with :
71
+ channel : ' stable'
72
+ - name : Setup pub credentials
73
+ shell : bash
74
+ env :
75
+ PUB_DEV_PUBLISH_ACCESS_TOKEN : ${{ secrets.PUB_DEV_PUBLISH_ACCESS_TOKEN }}
76
+ PUB_DEV_PUBLISH_REFRESH_TOKEN : ${{ secrets.PUB_DEV_PUBLISH_REFRESH_TOKEN }}
77
+ run : |
78
+ sh ./tool/pub_login.sh
79
+ - name : Publish package
80
+ run : dart pub publish -v -f
Original file line number Diff line number Diff line change
1
+ # This script creates/updates credentials.json file which is used
2
+ # to authorize publisher when publishing packages to pub.dev
3
+
4
+ # Checking whether the secrets are available as environment
5
+ # variables or not.
6
+ if [ -z " ${PUB_DEV_PUBLISH_ACCESS_TOKEN} " ]; then
7
+ echo " Missing PUB_DEV_PUBLISH_ACCESS_TOKEN environment variable"
8
+ exit 1
9
+ fi
10
+
11
+ if [ -z " ${PUB_DEV_PUBLISH_REFRESH_TOKEN} " ]; then
12
+ echo " Missing PUB_DEV_PUBLISH_REFRESH_TOKEN environment variable"
13
+ exit 1
14
+ fi
15
+
16
+ # Create credentials.json file.
17
+ mkdir -p ~ /.config/dart
18
+ cat << EOF > ~/.config/dart/pub-credentials.json
19
+ {
20
+ "accessToken": "${PUB_DEV_PUBLISH_ACCESS_TOKEN} ",
21
+ "refreshToken": "${PUB_DEV_PUBLISH_REFRESH_TOKEN} ",
22
+ "tokenEndpoint": "https://accounts.google.com/o/oauth2/token",
23
+ "scopes": ["https://www.googleapis.com/auth/userinfo.email","openid"],
24
+ "expiration": 1655303397262
25
+ }
26
+ EOF
You can’t perform that action at this time.
0 commit comments