diff --git a/.github/workflows/check-semver.yaml b/.github/workflows/check-semver.yaml new file mode 100644 index 000000000..10f325cb2 --- /dev/null +++ b/.github/workflows/check-semver.yaml @@ -0,0 +1,39 @@ +name: check semver + +on: + workflow_dispatch: + pull_request: + paths: + - 'packages/patrol/**' + +jobs: + check_semver: + name: Check semver + runs-on: ubuntu-latest + + 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" + + - name: Set up Dart + uses: dart-lang/setup-dart@v1 + with: + sdk: stable + + - 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 diff --git a/.github/workflows/patrol-publish.yaml b/.github/workflows/patrol-publish.yaml index 675f2796e..617035079 100644 --- a/.github/workflows/patrol-publish.yaml +++ b/.github/workflows/patrol-publish.yaml @@ -29,13 +29,6 @@ jobs: 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 uses: dart-lang/setup-dart@v1 @@ -48,16 +41,6 @@ jobs: flutter-version: ${{ matrix.flutter-version }} channel: ${{ matrix.flutter-channel }} - - name: Install dart-apitool - run: dart pub global activate dart_apitool - - # Temporary disabled until we will find better way to check latest released version - # - 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