-
Notifications
You must be signed in to change notification settings - Fork 0
47 lines (37 loc) · 1.15 KB
/
release.yml
File metadata and controls
47 lines (37 loc) · 1.15 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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
name: Tagged Release
on:
push:
tags:
- "v*"
permissions:
contents: write
jobs:
release:
name: Build, Test & Release
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Verify tag matches CMakeLists version
run: |
TAG_VERSION="${GITHUB_REF_NAME#v}"
CMAKE_VERSION=$(grep -oP 'project\s*\([^)]*VERSION\s+\K[0-9]+\.[0-9]+\.[0-9]+' CMakeLists.txt)
if [ "$TAG_VERSION" != "$CMAKE_VERSION" ]; then
echo "ERROR: Tag version ($TAG_VERSION) does not match CMakeLists.txt version ($CMAKE_VERSION)"
exit 1
fi
echo "Version verified: $TAG_VERSION"
- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install -y gcc g++
- name: Configure
run: cmake -B build -DBUILD_TESTS=ON -DBUILD_EXAMPLES=ON
- name: Build
run: cmake --build build
- name: Test
run: ctest --test-dir build --output-on-failure
- name: Create GitHub Release
uses: softprops/action-gh-release@v2
with:
generate_release_notes: true