4747 - name : Publish (dry run)
4848 run : dart pub publish --dry-run
4949
50- merge- to-staging :
50+ to-staging :
5151 needs : [test, analyze]
5252 runs-on : ubuntu-latest
5353 steps :
5757 with :
5858 type : now
5959 target_branch : staging
60- github_token : ${{ github.token }}
60+ github_token : ${{ github.token }}
61+
62+ to-pubdev :
63+ needs : [test, analyze]
64+ runs-on : ubuntu-latest
65+ if : github.event.head_commit.message=='publish'
66+ container :
67+ image : google/dart:latest
68+ steps :
69+ - uses : actions/checkout@v1
70+ - name : Setup credentials
71+ # data from cat ~/.pub-cache/credentials.json
72+ run : |
73+ mkdir -p ~/.pub-cache
74+ cat <<EOF > ~/.pub-cache/credentials.json
75+ {
76+ "accessToken":"${{ secrets.PUBDEV_ACCESS_TOKEN }}",
77+ "refreshToken":"${{ secrets.PUBDEV_REFRESH_TOKEN }}",
78+ "tokenEndpoint":"https://accounts.google.com/o/oauth2/token",
79+ "scopes": [ "openid", "https://www.googleapis.com/auth/userinfo.email" ],
80+ "expiration": 1570721159347
81+ }
82+ EOF
83+ - name : Publish package
84+ run : pub publish -f
85+ # run: pub publish -dry-run
86+
87+ to-master :
88+ needs : to-pubdev
89+ runs-on : ubuntu-latest
90+ steps :
91+ - uses : actions/checkout@master
92+ - name : Merge current -> master
93+ uses : devmasx/merge-branch@v1.3.1
94+ with :
95+ type : now
96+ target_branch : master
97+ github_token : ${{ github.token }}
98+
99+
100+
101+
102+ # pub:
103+ # if: startsWith(github.event.ref, 'refs/tags/rc')
104+ # runs-on: ubuntu-latest
105+ # steps:
106+ # - name: echo
107+ # run: echo "Yes"
108+ #
109+ # merge-to-master:
110+ # needs: [test, analyze]
111+ # if: startsWith(github.event.ref, 'refs/tags/rc')
112+ # runs-on: ubuntu-latest
113+ # steps:
114+ # - uses: actions/checkout@v2
115+ # - name: Merge current -> master
116+ # uses: devmasx/merge-branch@v1.3.1
117+ # with:
118+ # type: now
119+ # target_branch: master
120+ # github_token: ${{ github.token }}
0 commit comments