Skip to content

Commit

Permalink
Move ldmx-sw versioning to dedicated file (#1546)
Browse files Browse the repository at this point in the history
* Move ldmx-sw versioning to dedicated file

---------

Co-authored-by: Tom Eichlersmith <[email protected]>
  • Loading branch information
tvami and tomeichlersmith authored Jan 29, 2025
1 parent 5de33da commit 0783bd7
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 9 deletions.
6 changes: 3 additions & 3 deletions .github/actions/common.sh
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@

# Print the gold label
ldmx_gold_label() {
cat ${LDMX_GOLD_LABEL_FILE}
cat ${LDMX_VERSION_FILE}
}

# container running command
Expand Down Expand Up @@ -66,9 +66,9 @@ warn() {
}

start_group Deduce Common Environment Variables
export LDMX_GOLD_LABEL_FILE=${GITHUB_WORKSPACE}/.github/actions/validate/gold_label
export LDMX_BASE=$(cd ${GITHUB_WORKSPACE}/../ && pwd)
echo "LDMX_GOLD_LABEL_FILE=${LDMX_GOLD_LABEL_FILE}"
export LDMX_VERSION_FILE=${LDMX_BASE}/ldmx-sw/VERSION
echo "LDMX_VERSION_FILE=${LDMX_VERSION_FILE}"
echo "LDMX_BASE=${LDMX_BASE}"
end_group

2 changes: 1 addition & 1 deletion .github/workflows/generate_pr_gold.yml
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ jobs:
source ${GITHUB_WORKSPACE}/.github/actions/common.sh
start_group Update Gold Label
echo "Old Label: $(ldmx_gold_label)"
echo "${GITHUB_REF##refs/tags/}" > ${LDMX_GOLD_LABEL_FILE}
echo "${GITHUB_REF##refs/tags/}" > ${LDMX_VERSION_FILE}
echo "New Label: $(ldmx_gold_label)"
git add ${LDMX_GOLD_LABEL_FILE}
end_group
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/pr_validation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ jobs:
shell: bash

- name: Git Gold Histograms from trunk
run: git checkout origin/trunk -- .github/validation_samples/*/gold.root .github/actions/validate/gold_label
run: git checkout origin/trunk -- .github/validation_samples/*/gold.root VERSION
shell: bash

- name: Package ldmx-sw Into Artifact
Expand Down
5 changes: 4 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,10 @@ if ("${srcdir}" STREQUAL "${bindir}")
endif()

# Set the project name
project(LDMX_SW VERSION 3.1.1
file(READ ${CMAKE_CURRENT_SOURCE_DIR}/VERSION LDMXSW_VERSION)
string(STRIP "${LDMXSW_VERSION}" LDMXSW_VERSION)
string(REGEX REPLACE "^v" "" LDMXSW_VERSION_NUM "${LDMXSW_VERSION}")
project(LDMX_SW VERSION ${LDMXSW_VERSION_NUM}
DESCRIPTION "The Light Dark Matter eXperiment simulation and reconstruction framework."
LANGUAGES CXX
)
Expand Down
3 changes: 0 additions & 3 deletions Framework/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -65,9 +65,6 @@ else()
endif()
message(STATUS "Deduced git SHA: ${GIT_SHA1}")

# Include ldmx-sw version in the Run Header
file(READ ${PROJECT_SOURCE_DIR}/../.github/actions/validate/gold_label LDMXSW_VERSION)
string(STRIP "${LDMXSW_VERSION}" LDMXSW_VERSION)

# Copies the file 'Version.h.in', substitutes the value of GIT_SHA1 and writes
# it out to Version.h.
Expand Down
File renamed without changes.

0 comments on commit 0783bd7

Please sign in to comment.