1+ name : main
2+
13on :
2- pull_request :
3- branches :
4- - dev
54 push :
6- branches :
7- - master
5+ branches : [ main ]
6+ pull_request :
7+ branches : [ main ]
88
9- name : " Build & Release"
109jobs :
11- release :
10+ build :
1211 runs-on : ubuntu-latest
12+
1313 steps :
14- - uses : actions/checkout@v4
15-
16- - name : Setup Flutter
17- uses : subosito/flutter-action@v2
14+ - uses : actions/checkout@v3
15+ - uses : subosito/flutter-action@v2
1816 with :
1917 flutter-version : ' 3.19.0'
2018 channel : ' stable'
21-
19+
2220 - name : Install dependencies
2321 run : flutter pub get
24-
25- - name : Run tests
26- run : flutter test
27-
28- - name : Verify package
29- run : dart pub publish --dry-run
30-
31- - name : Publish to pub.dev
32- run : dart pub publish --force
33- env :
34- PUB_DEV_PUBLISH_ACCESS_TOKEN : ${{ secrets.REPO_TOKEN_FLUTTER_PKG }}
35-
22+
23+ - name : Verify formatting
24+ run : dart format --output=none --set-exit-if-changed .
25+
26+ - name : Analyze project source
27+ run : flutter analyze
28+
29+ - name : Create and push tag
30+ run : |
31+ TAG="v1.0.${{ github.run_number }}"
32+ git config user.name "github-actions[bot]"
33+ git config user.email "github-actions[bot]@users.noreply.github.com"
34+ git tag $TAG
35+ git push origin $TAG
36+
3637 - name : Create Release
3738 uses : softprops/action-gh-release@v1
3839 with :
3940 files : |
4041 LICENSE
4142 CHANGELOG.md
4243 README.md
44+ tag_name : v1.0.${{ github.run_number }}
45+ token : ${{ secrets.REPO_TOKEN_FLUTTER_PKG }}
4346
44- - name : Push to Releases
45- uses : ncipollo/release -action@v1
47+ - name : Upload coverage to Codecov
48+ uses : codecov/codecov -action@v3
4649 with :
47- tag : v1.0.${{ github.run_number }}
4850 token : ${{ secrets.REPO_TOKEN_FLUTTER_PKG }}
49-
51+ file : ./coverage/lcov.info
52+ fail_ci_if_error : true
0 commit comments