-
Notifications
You must be signed in to change notification settings - Fork 9
36 lines (33 loc) · 1.03 KB
/
version_checker.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
name: VersionChecker
on:
push:
tags:
- 'v*'
jobs:
checker:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Version check
id: check
run: |
mkdir build
cd build
cmake .. || true
CMAKE_VERSION="v$(cat CMakeCache.txt | grep '^CMAKE_PROJECT_VERSION\b' | cut -d "=" -f2)"
GIT_VERSION=$(git describe --tags --abbrev=0)
if [ "$CMAKE_VERSION" != "$GIT_VERSION" ]; then
echo ::set-output name=CMAKE_ISSUE::yes
echo ::set-output name=CMAKE_VERSION::$CMAKE_VERSION
echo ::set-output name=GIT_VERSION::$GIT_VERSION
fi
- uses: JasonEtco/[email protected]
if: steps.check.outputs.CMAKE_ISSUE == 'yes'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
CMAKE_VERSION: ${{ steps.check.outputs.CMAKE_VERSION }}
GIT_VERSION: ${{ steps.check.outputs.GIT_VERSION }}
with:
filename: .github/tag-issue.md