name: Publish to pub.dev

on:
  release:
    types: [released]
    branches:
      - master

jobs:
  publish:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v3
      - name: Install Flutter
        uses: subosito/flutter-action@v2
        with:
          flutter-version: '3.7.7'
      - name: Install dependencies
        run: flutter pub get
      # - name: Check Publish Warnings
      #   run: dart pub publish --dry-run
      - name: Publish
        uses: k-paxian/dart-package-publisher@v1.5.1
        with:
          credentialJson: ${{ secrets.CREDENTIAL_JSON }}
          flutter: true
          skipTests: true
          force: true
