Skip to content

Commit fab3429

Browse files
Update pub_workflow.yml
1 parent 16440a2 commit fab3429

File tree

1 file changed

+10
-22
lines changed

1 file changed

+10
-22
lines changed

.github/workflows/pub_workflow.yml

Lines changed: 10 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,14 @@
11
name: Publish to pub.dev
2+
23
on:
3-
release:
4-
types: [published]
4+
push:
5+
tags:
6+
- '[0-9]+.[0-9]+.[0-9]+*'
57

68
jobs:
7-
build:
8-
runs-on: ubuntu-latest
9-
container:
10-
image: google/dart:latest
11-
steps:
12-
- uses: actions/checkout@v1
13-
- name: Setup credentials
14-
run: |
15-
mkdir -p ~/.config/dart
16-
cat <<EOF > ~/.config/dart/pub-credentials.json
17-
{
18-
"accessToken":"${{ secrets.OAUTH_ACCESS_TOKEN }}",
19-
"refreshToken":"${{ secrets.OAUTH_REFRESH_TOKEN }}",
20-
"tokenEndpoint":"https://accounts.google.com/o/oauth2/token",
21-
"scopes": [ "openid", "https://www.googleapis.com/auth/userinfo.email" ],
22-
"expiration": 1584628470088
23-
}
24-
EOF
25-
- name: Publish package
26-
run: dart pub publish -f
9+
publish:
10+
permissions:
11+
id-token: write
12+
uses: dart-lang/setup-dart/.github/workflows/publish.yml@v1
13+
with:
14+
environment: pub.dev

0 commit comments

Comments
 (0)