-
Notifications
You must be signed in to change notification settings - Fork 146
56 lines (46 loc) · 1.42 KB
/
patrol-check-semver.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
name: Check semver
on:
workflow_dispatch:
pull_request:
jobs:
get_last_released_version:
name: Get last released version
runs-on: ubuntu-latest
outputs:
last_version: ${{ steps.get_last_released_version.outputs.last_version }}
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"
semver:
name: Check API changes
runs-on: ubuntu-latest
needs: [get_last_released_version]
steps:
- name: Clone repository
uses: actions/checkout@v4
- 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/${{ needs.get_last_released_version.outputs.last_version }} \
--new packages/patrol
report:
name: Report success
runs-on: ubuntu-latest
needs: [get_last_released_version, semver]
steps:
- name: Print success
run: echo "Success"