diff --git a/.github/workflows/patrol-publish.yaml b/.github/workflows/patrol-publish.yaml index 441765446..6c84c1e75 100644 --- a/.github/workflows/patrol-publish.yaml +++ b/.github/workflows/patrol-publish.yaml @@ -26,6 +26,15 @@ jobs: steps: - name: Clone repository uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - name: Get last released version + id: get_last_released_version + run: | + last_version=$(git tag --list 'patrol-v*' | grep -v '\-dev\.[0-9]\+$' | sort -V | tail -n 1 | sed 's/^patrol-v//') + echo "last_version=$last_version" >> $GITHUB_ENV + echo "::set-output name=last_version::$last_version" # This step adds the auth token for pub.dev - name: Set up Dart @@ -39,6 +48,15 @@ jobs: flutter-version: ${{ matrix.flutter-version }} channel: ${{ matrix.flutter-channel }} + - name: Install dart-apitool + run: dart pub global activate dart_apitool + + - name: Check API changes + run: | + dart-apitool diff \ + --old pub://patrol/${{ steps.get_last_released_version.outputs.last_version }} \ + --new packages/patrol + - name: Build DevTools extension working-directory: packages/patrol_devtools_extension run: ./publish_to_patrol_extension