added new publishing steps #10
This file contains hidden or 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: CI | |
on: | |
push: | |
branches: [main] | |
pull_request: | |
branches: [main] | |
jobs: | |
test: | |
name: Test on ${{ matrix.os }} | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
os: [ubuntu-latest, macos-latest, windows-latest] | |
include: | |
- os: ubuntu-latest | |
flutter_path: /opt/hostedtoolcache/flutter | |
- os: macos-latest | |
flutter_path: /Users/runner/hostedtoolcache/flutter | |
- os: windows-latest | |
flutter_path: C:\hostedtoolcache\windows\flutter | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Setup Flutter | |
uses: subosito/flutter-action@v2 | |
with: | |
flutter-version: '3.27.0' | |
channel: 'stable' | |
- name: Install dependencies | |
run: flutter pub get | |
- name: Verify formatting | |
run: dart format --output=none --set-exit-if-changed . | |
- name: Analyze project source | |
run: flutter analyze | |
- name: Run tests | |
run: flutter test | |
- name: Check pub score | |
run: | | |
dart pub global activate pana | |
export PATH="$PATH:$HOME/.pub-cache/bin" | |
# Allow for 10 point deduction due to dependency constraints | |
# (permission_handler is constrained by daily_flutter) | |
echo "Running pana analysis..." | |
pana --no-warning --exit-code-threshold 10 | tee pana-output.txt | |
echo "" | |
echo "Note: permission_handler is constrained to ^11.3.1 by daily_flutter 0.31.0" | |
echo "This causes a 10-point deduction in the pub score." | |
example: | |
name: Build example app | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Setup Flutter | |
uses: subosito/flutter-action@v2 | |
with: | |
flutter-version: '3.27.0' | |
channel: 'stable' | |
- name: Install dependencies (root) | |
run: flutter pub get | |
- name: Install dependencies (example) | |
run: | | |
cd example | |
flutter pub get | |
- name: Build Android APK | |
run: | | |
cd example | |
flutter build apk --debug | |
- name: Build iOS (simulator only) | |
if: matrix.os == 'macos-latest' | |
run: | | |
cd example | |
flutter build ios --debug --simulator | |
publish-dry-run: | |
name: Publish dry run | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Setup Flutter | |
uses: subosito/flutter-action@v2 | |
with: | |
flutter-version: '3.27.0' | |
channel: 'stable' | |
- name: Install dependencies | |
run: flutter pub get | |
- name: Publish dry run | |
run: flutter pub publish --dry-run |