-
Notifications
You must be signed in to change notification settings - Fork 46
31 lines (26 loc) · 1.02 KB
/
check-version.yml
File metadata and controls
31 lines (26 loc) · 1.02 KB
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
name: Check version
on:
pull_request:
branches: [ $default-branch, master ]
jobs:
check:
name: Check that the version is valid
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- name: moordyn_version
id: moordyn_version
shell: bash
run: |
major=`cat CMakeLists.txt | grep MOORDYN_MAJOR_VERSION | head -1 | awk -F' ' '{print $2}' | awk -F')' '{print $1}'`
minor=`cat CMakeLists.txt | grep MOORDYN_MINOR_VERSION | head -1 | awk -F' ' '{print $2}' | awk -F')' '{print $1}'`
patch=`cat CMakeLists.txt | grep MOORDYN_PATCH_VERSION | head -1 | awk -F' ' '{print $2}' | awk -F')' '{print $1}'`
echo "moordyn_version=$major.$minor.$patch" >> $GITHUB_OUTPUT
- name: Tag check
uses: mukunku/tag-exists-action@v1.7.0
id: checkTag
with:
tag: "v${{steps.moordyn_version.outputs.moordyn_version}}"
- name: Stop if tag exists
run: |
if [ ${{ steps.checkTag.outputs.exists }} == true ]; then exit 1; else exit 0; fi