forked from printeastwoodcz/flagsmith_core
-
Notifications
You must be signed in to change notification settings - Fork 2
48 lines (44 loc) · 1.22 KB
/
publish_main.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
name: Analyze, test and publish
on:
push:
branches:
- 'main'
jobs:
analyze:
runs-on: ubuntu-latest
name: Dart Analyze
steps:
- uses: actions/checkout@v4
- uses: subosito/flutter-action@v2
- run: flutter pub get
- run: flutter analyze
score:
runs-on: ubuntu-latest
name: Dart package score
steps:
- uses: actions/checkout@v4
- uses: axel-op/dart-package-analyzer@v3
with:
githubToken: ${{ secrets.GITHUB_TOKEN }}
publishing:
runs-on: ubuntu-latest
container:
image: google/dart:latest
name: Dart Publish Package
needs: analyze
steps:
- uses: actions/checkout@v4
- name: Setup credentials
run: |
mkdir -p ~/.pub-cache
cat <<EOF > ~/.pub-cache/credentials.json
{
"accessToken":"${{ secrets.OAUTH_ACCESS_TOKEN }}",
"refreshToken":"${{ secrets.OAUTH_REFRESH_TOKEN }}",
"tokenEndpoint":"https://accounts.google.com/o/oauth2/token",
"scopes": [ "openid", "https://www.googleapis.com/auth/userinfo.email" ],
"expiration": 1649072931936
}
EOF
- name: Publish package
run: pub publish -f