Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

release: update citation.cff, fix #695 #696

Merged
merged 1 commit into from
May 21, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions release.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,17 @@ macro(RELEASE_SETUP)
# cmake-format: on
)

add_custom_target(
release_citation_cff
WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}
COMMENT "Update CITATION.cff"
COMMAND
sed -i.back
"\"s|^version:.*|version: $$VERSION|;s|^date-released:.*|date-released: \\\"${TODAY}\\\"|\""
CITATION.cff && rm CITATION.cff.back && ${GIT} add CITATION.cff &&
${GIT} commit -m "release: Update CITATION.cff version to $$VERSION" &&
echo "Updated CITATION.cff and committed")

set(BUILD_CMD ${CMAKE_COMMAND} --build ${CMAKE_BINARY_DIR} --target)
add_custom_target(
release
Expand All @@ -144,6 +155,8 @@ macro(RELEASE_SETUP)
if [ -f "CHANGELOG.md" ]; then (${BUILD_CMD} release_changelog) ; fi &&
# Update version in pixi.toml if it exists
if [ -f "pixi.toml" ]; then (${BUILD_CMD} release_pixi_toml) ; fi &&
# Update date and version in CITATION.cff if it exists
if [ -f "CITATION.cff" ]; then (${BUILD_CMD} release_citation_cff) ; fi &&
${GIT} tag -s v$$VERSION -m "Release of version $$VERSION." &&
cd ${CMAKE_BINARY_DIR} &&
cmake ${PROJECT_SOURCE_DIR} &&
Expand Down
Loading