-
Notifications
You must be signed in to change notification settings - Fork 35
52 lines (42 loc) · 1.49 KB
/
pub.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
# This workflow uses actions that are not certified by GitHub.
# They are provided by a third-party and are governed by
# separate terms of service, privacy policy, and support
# documentation.
name: Publish Package
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Install Flutter
uses: subosito/[email protected]
- name: Install dependencies
run: flutter pub get
- name: Analyze
run: flutter analyze
# Your project will need to have tests in test/ and a dependency on
# package:test for this step to succeed. Note that Flutter projects will
# want to change this to 'flutter test'.
- name: Run tests
run: flutter test
- name: Setup credentials
run: |
mkdir -p ~/.pub-cache
cat <<EOF > ~/.pub-cache/credentials.json
{
"accessToken":"${{ secrets.PUB_DEV_PUBLISH_ACCESS_TOKEN }}",
"refreshToken":"${{ secrets.PUB_DEV_PUBLISH_REFRESH_TOKEN }}",
"tokenEndpoint":"${{ secrets.PUB_DEV_PUBLISH_TOKEN_ENDPOINT }}",
"scopes": [ "openid", "https://www.googleapis.com/auth/userinfo.email" ],
"expiration": "${{ secrets.PUB_DEV_PUBLISH_EXPIRATION }}
}
EOF
- name: Check Publish Warnings
run: flutter pub publish --dry-run
- name: Publish package
run: flutter pub publish -f