add publish workflow #40
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Dart | |
on: | |
push: | |
branches: ["main"] | |
pull_request: | |
branches: ["main"] | |
jobs: | |
pubspec: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- id: pubspec | |
name: Generate matrix from pubspec.yaml | |
uses: flutter-actions/pubspec-matrix-action@v1 | |
with: | |
channel: "stable" | |
outputs: | |
matrix: ${{ steps.pubspec.outputs.matrix }} | |
build: | |
needs: [pubspec] | |
strategy: | |
matrix: ${{fromJson(needs.pubspec.outputs.matrix)}} | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: flutter-actions/setup-flutter@v3 | |
with: | |
channel: "stable" | |
version: ${{ matrix.release.flutter }} | |
- run: flutter --version | |
- run: dart pub add lints | |
- run: dart pub add test | |
- name: Install dependencies | |
run: flutter pub get | |
- name: Verify formatting | |
run: dart format --output=none --set-exit-if-changed . | |
- name: Analyze project source | |
run: dart analyze --fatal-infos | |
- name: Run tests | |
run: flutter test |