Skip to content

Commit 5bed9e3

Browse files
committed
CI
1 parent af2ab73 commit 5bed9e3

4 files changed

Lines changed: 38 additions & 19 deletions

File tree

.github/workflows/_base-dart.yaml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,3 +108,20 @@ jobs:
108108
- name: Run tests
109109
run: dart test --reporter=expanded test/*.dart
110110
working-directory: ${{ inputs.path }}
111+
112+
publish:
113+
runs-on: ubuntu-latest
114+
# Needs dart or flutter job to complete successfully, only skipped if either is failed, but not skipped
115+
needs: [test, analyze, format]
116+
if: ${{ github.event_name == 'release' && github.event.action == 'published' || github.ref == 'refs/heads/main' }}
117+
steps:
118+
- uses: actions/checkout@v5
119+
- uses: dart-lang/setup-dart@v1
120+
with:
121+
sdk: stable
122+
123+
- name: "Get dependencies"
124+
run: dart pub get
125+
126+
- name: Publish to pub.dev (dry run)
127+
run: dart pub publish --dry-run

.github/workflows/_base-flutter.yaml

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,8 @@ jobs:
7070
- name: "dart format"
7171
run: |
7272
echo "Checking Dart formatting...\nFiles displayed below:"
73-
dart format --set-exit-if-changed .
73+
dart format -o none --set-exit-if-changed ./lib/
74+
if [ -d "${{ inputs.path }}/test" ]; then dart format -o none --set-exit-if-changed ./test/; fi
7475
echo "No formatting issues found."
7576
working-directory: ${{ inputs.path }}
7677

@@ -113,3 +114,21 @@ jobs:
113114
- name: Run tests
114115
run: flutter test --reporter=expanded test/*.dart
115116
working-directory: ${{ inputs.path }}
117+
118+
publish:
119+
runs-on: ubuntu-latest
120+
# Needs dart or flutter job to complete successfully, only skipped if either is failed, but not skipped
121+
needs: [test, analyze, format]
122+
if: ${{ github.event_name == 'release' && github.event.action == 'published' || github.ref == 'refs/heads/main' }}
123+
steps:
124+
- uses: actions/checkout@v5
125+
- uses: subosito/flutter-action@v2
126+
with:
127+
channel: stable
128+
cache: true
129+
130+
- name: "Get dependencies"
131+
run: flutter pub get
132+
133+
- name: Publish to pub.dev (dry run)
134+
run: flutter pub publish --dry-run

.github/workflows/package.yaml

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -38,20 +38,3 @@ jobs:
3838
uses: ./.github/workflows/_base-flutter.yaml
3939
with:
4040
path: '.'
41-
42-
publish:
43-
runs-on: ubuntu-latest
44-
# Needs dart or flutter job to complete successfully, only skipped if either is failed, but not skipped
45-
needs: [dart, flutter]
46-
if: ${{ always() && (needs.dart.result == 'success' || needs.flutter.result == 'success') && (needs.dart.result != 'failure' && needs.flutter.result != 'failure') && (github.event_name == 'release' && github.event.action == 'published' || github.ref == 'refs/heads/main') }}
47-
steps:
48-
- uses: actions/checkout@v5
49-
- uses: dart-lang/setup-dart@v1
50-
with:
51-
sdk: stable
52-
53-
- name: "Get dependencies"
54-
run: dart pub get
55-
56-
- name: Publish to pub.dev (dry run)
57-
run: dart pub publish --dry-run

example/editor/pubspec.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ dev_dependencies:
4848
# activated in the `analysis_options.yaml` file located at the root of your
4949
# package. See that file for information about deactivating specific lint
5050
# rules and activating additional ones.
51-
flutter_lints: ^5.0.0
51+
flutter_lints: ^6.0.0
5252

5353
# For information on the generic Dart part of this file, see the
5454
# following page: https://dart.dev/tools/pub/pubspec

0 commit comments

Comments
 (0)