Skip to content

Commit

Permalink
Add check-semver workflow for patrol_finders
Browse files Browse the repository at this point in the history
  • Loading branch information
piotruela committed Oct 14, 2024
1 parent a0e1ae3 commit 9a28059
Show file tree
Hide file tree
Showing 2 changed files with 48 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: check semver
name: patrol check semver

on:
workflow_dispatch:
Expand Down Expand Up @@ -37,7 +37,7 @@ jobs:
channel: ${{ matrix.flutter-channel }}

- name: Install dart-apitool
run: dart pub global activate dart_apitool
run: dart pub global activate dart_apitool 0.19.0

- name: Check API changes
run: |
Expand Down
46 changes: 46 additions & 0 deletions .github/workflows/patrol_finders-check-semver.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
name: patrol_finders check semver

on:
workflow_dispatch:
pull_request:
paths:
- 'packages/patrol_finders/**'

jobs:
check_semver:
name: Check semver
runs-on: ubuntu-latest

strategy:
fail-fast: false
matrix:
flutter-version: ['3.24.x']
flutter-channel: ['stable']

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_finders-v*' | grep -v '\-dev\.[0-9]\+$' | sort -V | tail -n 1 | sed 's/^patrol_finders-v//')
echo "last_version=$last_version" >> $GITHUB_ENV
echo "::set-output name=last_version::$last_version"
- name: Set up Flutter
uses: subosito/flutter-action@v2
with:
flutter-version: ${{ matrix.flutter-version }}
channel: ${{ matrix.flutter-channel }}

- name: Install dart-apitool
run: dart pub global activate dart_apitool 0.19.0

- name: Check API changes
run: |
dart-apitool diff \
--old pub://patrol_finders/${{ steps.get_last_released_version.outputs.last_version }} \
--new packages/patrol_finders

0 comments on commit 9a28059

Please sign in to comment.