Skip to content

Commit

Permalink
Update dart.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
mocolicious authored Jul 17, 2024
1 parent c2b57a5 commit d03c8f7
Showing 1 changed file with 29 additions and 37 deletions.
66 changes: 29 additions & 37 deletions .github/workflows/dart.yml
Original file line number Diff line number Diff line change
@@ -1,46 +1,38 @@
name: Dart
name: Dart Package

on:
push:
branches: [ "main" ]
branches:
- main
pull_request:
branches: [ "main" ]
branches:
- main

jobs:
build:
publish:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4

# Setting up the Flutter SDK
- uses: subosito/flutter-action@v2
with:
flutter-version: '3.22.2'

- name: Install dependencies
run: flutter pub get

# Uncomment this step to verify the use of 'dart format' on each commit.
# - name: Verify formatting
# run: flutter format --output=none --set-exit-if-changed .

# Conditional step for analyzing the project source
#- name: Analyze project source
# if: ${{ secrets.SKIP_ANALYZE != 'true' }}
# run: flutter analyze

# Run tests
# - name: Run tests
# run: flutter test

- name: dart-package
uses: nikosportolos/dart_package@v0.2.1
with:
coverage: false
codecov: false
codecov_token: ${{ secrets.CODECOV_TOKEN }}
publish: true
pubdev_token: ${{ secrets.PUBDEV_TOKEN }}
sdk: flutter
flutter-sdk: '3.22.2'
- name: Checkout repository
uses: actions/checkout@v2

- name: Set up Dart
uses: nikosportolos/dart_package@v0.2.1
with:
sdk: 'stable'

- name: Install dependencies
run: dart pub get

- name: Run tests
run: dart test

- name: Publish to pub.dev (dry run)
env:
PUB_DEV_TOKEN: ${{ secrets.PUB_DEV_TOKEN }}
run: dart pub publish --dry-run

- name: Publish to pub.dev
if: github.ref == 'refs/heads/main' && github.event_name == 'push'
env:
PUB_DEV_TOKEN: ${{ secrets.PUB_DEV_TOK

0 comments on commit d03c8f7

Please sign in to comment.