-
Notifications
You must be signed in to change notification settings - Fork 0
41 lines (33 loc) · 1.02 KB
/
version.yml
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
name: Check version
on:
pull_request:
branches: master
jobs:
check-version:
name: Package version updated
runs-on: ubuntu-latest
steps:
- uses: actions/setup-python@v4
with:
python-version: '3.10'
- uses: actions/checkout@v4
with:
submodules: recursive
- name: Retrieve new version number
id: new-version
run: |
echo "version=$(python setup.py --version)" >> "$GITHUB_OUTPUT"
- uses: actions/checkout@v4
with:
submodules: recursive
ref: ${{ github.base_ref }}
- name: Retrieve target branch version number
id: target-version
run: |
echo "version=$(python setup.py --version)" >> "$GITHUB_OUTPUT"
- name: Compare version numbers
env:
NEW_VERSION: ${{ steps.new-version.outputs.version }}
TARGET_VERSION: ${{ steps.target-version.outputs.version }}
run: |
! (printf '%s\n' "$NEW_VERSION" "$TARGET_VERSION" | sort -C -V)