@@ -24,21 +24,22 @@ jobs:
2424 strategy :
2525 matrix :
2626 os : [ubuntu-latest, windows-latest] # , macos-latest
27+ platform : [vm, chrome] # , macos-latest
2728 steps :
2829 - uses : actions/checkout@v2
2930 - uses : dart-lang/setup-dart@v1
3031 - name : Install dependencies
3132 run : dart pub get
32- - name : Run tests VM
33- run : dart test
34- - name : Run tests Web
35- run : dart test --platform chrome
33+ - name : Run tests
34+ run : dart test --platform ${{ matrix.platform }}
3635
3736 analyze :
3837 runs-on : ubuntu-latest
38+ container :
39+ image : google/dart:latest
3940 steps :
4041 - uses : actions/checkout@v2
41- - uses : dart-lang/setup-dart@v1
42+ # - uses: dart-lang/setup-dart@v1
4243 - name : Install dependencies
4344 run : dart pub get
4445 - name : Analyze
5859 target_branch : staging
5960 github_token : ${{ github.token }}
6061
61- to-pubdev :
62- needs : [test, analyze]
63- runs-on : ubuntu-latest
62+ to-master :
6463 if : github.event.head_commit.message=='publish'
65- container :
66- image : google/dart:latest
67- steps :
68- - uses : actions/checkout@v1
69- - name : Setup credentials
70- # data from cat ~/.pub-cache/credentials.json
71- run : |
72- mkdir -p ~/.pub-cache
73- cat <<EOF > ~/.pub-cache/credentials.json
74- {
75- "accessToken":"${{ secrets.PUBDEV_ACCESS_TOKEN }}",
76- "refreshToken":"${{ secrets.PUBDEV_REFRESH_TOKEN }}",
77- "tokenEndpoint":"https://accounts.google.com/o/oauth2/token",
78- "scopes": [ "openid", "https://www.googleapis.com/auth/userinfo.email" ],
79- "expiration": 1570721159347
80- }
81- EOF
82- - name : Publish package
83- run : pub publish -f
84-
85- release :
86- needs : to-pubdev
64+ needs : [test, analyze]
8765 runs-on : ubuntu-latest
8866 steps :
8967 - uses : actions/checkout@v2
@@ -106,4 +84,38 @@ jobs:
10684 with :
10785 tag_name : ${{ env.PKGVER }}
10886 env :
109- GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
87+ GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
88+
89+ to-pubdev :
90+ needs : to-master
91+ runs-on : ubuntu-latest
92+ container :
93+ image : google/dart:latest
94+ steps :
95+ - uses : actions/checkout@v2
96+
97+ - name : Install dependencies
98+ run : dart pub get
99+ - name : Format
100+ run : dart format .
101+ - name : Test formatted
102+ run : dart test
103+ - name : Analyze formatted
104+ run : dart analyze --fatal-infos
105+
106+ - name : Setup credentials
107+ # data from cat ~/.pub-cache/credentials.json
108+ run : |
109+ mkdir -p ~/.pub-cache
110+ cat <<EOF > ~/.pub-cache/credentials.json
111+ {
112+ "accessToken":"${{ secrets.PUBDEV_ACCESS_TOKEN }}",
113+ "refreshToken":"${{ secrets.PUBDEV_REFRESH_TOKEN }}",
114+ "tokenEndpoint":"https://accounts.google.com/o/oauth2/token",
115+ "scopes": [ "openid", "https://www.googleapis.com/auth/userinfo.email" ],
116+ "expiration": 1570721159347
117+ }
118+ EOF
119+ - name : Publish package
120+ run : pub publish -f
121+
0 commit comments