Auto-update version numbers in CMakeLists.txt (#450)

This commit is contained in:
Changho Hwang
2025-01-09 17:54:10 -08:00
committed by GitHub
parent f2b52c6318
commit 2b54af7e27
2 changed files with 8 additions and 3 deletions

View File

@@ -31,12 +31,17 @@ jobs:
sed -i "s/^release = \".*\"/release = \"v${VERSION}\"/" docs/conf.py
sed -i "s/^version = \".*\"/version = \"${VERSION}\"/" pyproject.toml
# Update header file
IFS='.' read -ra VER <<< "$VERSION"
MAJOR=${VER[0]}
MINOR=${VER[1]}
PATCH=${VER[2]}
# Update CMakeLists.txt
sed -i "s/set(MSCCLPP_MAJOR \".*\")/set(MSCCLPP_MAJOR \"${MAJOR}\")/" CMakeLists.txt
sed -i "s/set(MSCCLPP_MINOR \".*\")/set(MSCCLPP_MINOR \"${MINOR}\")/" CMakeLists.txt
sed -i "s/set(MSCCLPP_PATCH \".*\")/set(MSCCLPP_PATCH \"${PATCH}\")/" CMakeLists.txt
# Update header files
sed -i "s/#define MSCCLPP_MAJOR .*/#define MSCCLPP_MAJOR ${MAJOR}/" include/mscclpp/core.hpp
sed -i "s/#define MSCCLPP_MINOR .*/#define MSCCLPP_MINOR ${MINOR}/" include/mscclpp/core.hpp
sed -i "s/#define MSCCLPP_PATCH .*/#define MSCCLPP_PATCH ${PATCH}/" include/mscclpp/core.hpp