-
Notifications
You must be signed in to change notification settings - Fork 6
71 lines (59 loc) · 2.4 KB
/
rust-check-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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
name: Rust check version
on:
pull_request:
types:
- opened
- edited
- synchronize
branches:
- main
jobs:
version:
name: Check version
runs-on: ubuntu-latest
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
steps:
- name: Cancel Previous Runs
uses: styfle/[email protected]
with:
access_token: ${{ github.token }}
- name: Install Rust stable toolchain
uses: actions-rs/[email protected]
with:
profile: minimal
toolchain: stable
override: true
- name: Checkout base
uses: actions/[email protected]
if: github.event_name == 'pull_request'
with:
ref: ${{ github.event.pull_request.base.ref }}
fetch-depth: 50
submodules: 'recursive'
- name: Checkout before push
uses: actions/[email protected]
if: github.event_name != 'pull_request'
with:
ref: ${{ github.event.before }}
fetch-depth: 50
submodules: 'recursive'
- name: Get package version before or base
run: >
echo "BEFORE_VERSION=$(
cargo metadata --format-version=1 --no-deps |
jq -r '.packages[] | select(.name == "kalatori") | .version'
)" >> $GITHUB_ENV
- name: Checkout sources
uses: actions/[email protected]
with:
fetch-depth: 50
submodules: 'recursive'
- name: Get package version
run: >
echo "VERSION=$(
cargo metadata --format-version=1 --no-deps |
jq -r '.packages[] | select(.name == "kalatori") | .version'
)" >> $GITHUB_ENV
- name: Check which version is greater
run: ./is_version_greater.sh $VERSION $BEFORE_VERSION