Skip to content

Commit

Permalink
Merge pull request #696 from nim65s/citation
Browse files Browse the repository at this point in the history
release: update citation.cff, fix #695
  • Loading branch information
jcarpent authored May 21, 2024
2 parents 5275edf + 7d5bd02 commit 72f7235
Showing 1 changed file with 13 additions and 0 deletions.
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

0 comments on commit 72f7235

Please sign in to comment.