Skip to content

Commit

Permalink
Merge pull request #2341 from leancodepl/chore/check-semver
Browse files Browse the repository at this point in the history
Move check-semver.yaml to separate workflow
  • Loading branch information
piotruela authored Sep 20, 2024
2 parents 13c3927 + f442b86 commit 56426c5
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 17 deletions.
39 changes: 39 additions & 0 deletions .github/workflows/check-semver.yaml
Original file line number Diff line number Diff line change
@@ -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
17 changes: 0 additions & 17 deletions .github/workflows/patrol-publish.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down

0 comments on commit 56426c5

Please sign in to comment.