update CI. (#287)

* update.

* update.

* pub update.

* fix import_sorter.

* fix analyze.
This commit is contained in:
CloudWebRTC
2023-05-17 13:44:28 +08:00
committed by GitHub
parent 83f87547e7
commit e12dd60f5f
20 changed files with 179 additions and 61 deletions
+24 -13
View File
@@ -1,26 +1,37 @@
name: Publish build
on:
push:
# only publish on version tags
tags:
- v*
release:
types: [published]
jobs:
publish:
# This job will run on ubuntu virtual machine
runs-on: ubuntu-latest
steps:
# Setup the flutter environment.
- uses: subosito/flutter-action@v1
- uses: actions/checkout@v2
- name: Cache Flutter dependencies
uses: actions/cache@v1
- name: Install Flutter
uses: subosito/flutter-action@v2
with:
path: /opt/hostedtoolcache/flutter
key: ${{ runner.OS }}-flutter-install-cache-${{ env.flutter_version }}
flutter-version: '3.3.3'
- name: Install project dependencies
run: flutter pub get
- name: Dart Format Check
run: dart format lib/ test/ --set-exit-if-changed
- name: Import Sorter Check
run: dart run import_sorter:main --no-comments --exit-if-changed
- name: Dart Analyze Check
run: flutter analyze
- name: Dart Test Check
run: flutter test
- name: Check Publish Warnings
run: dart pub publish --dry-run
- name: Publish
uses: k-paxian/[email protected]
with:
credentialJson: ${{ secrets.CREDENTIAL_JSON }}
flutter: true
skipTests: true
force: true
- run: flutter pub get
- run: flutter pub global activate dartdoc