Skip to content

Commit

Permalink
[post-release] fix archiver.sh script to produce '1.00.01' from input…
Browse files Browse the repository at this point in the history
… '(1,0,1)' in __init__.py (issue madgraph5#1013)
  • Loading branch information
valassi committed Oct 3, 2024
1 parent e80938b commit acaef2c
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 5 deletions.
11 changes: 10 additions & 1 deletion .github/workflows/archiver.sh
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,17 @@ mkdir ${outdir}
outfile=${outdir}/VERSION.txt
touch ${outfile}
dateformat='%Y-%m-%d_%H:%M:%S UTC'
cudacpp_major=$(cat __init__.py | grep __version__ | sed -r 's/(.*=|\(|\)|,)/ /g' | awk '{print $1}')
cudacpp_minor=$(cat __init__.py | grep __version__ | sed -r 's/(.*=|\(|\)|,)/ /g' | awk '{print $2}')
cudacpp_patch=$(cat __init__.py | grep __version__ | sed -r 's/(.*=|\(|\)|,)/ /g' | awk '{print $3}')
echo "(From CUDACPP_OUTPUT/__init__.py)"
echo "cudacpp (major, minor, patch) = ( ${cudacpp_major}, ${cudacpp_minor}, ${cudacpp_patch} )"
if [ ${cudacpp_major} -lt 0 ] || [ ${cudacpp_major} -gt 99 ]; then echo "ERROR! cudacpp_major is not in the [0,99] range"; exit 1; fi
if [ ${cudacpp_minor} -lt 0 ] || [ ${cudacpp_minor} -gt 99 ]; then echo "ERROR! cudacpp_minor is not in the [0,99] range"; exit 1; fi
if [ ${cudacpp_patch} -lt 0 ] || [ ${cudacpp_patch} -gt 99 ]; then echo "ERROR! cudacpp_patch is not in the [0,99] range"; exit 1; fi
cudacpp_version=$(printf "%1d.%02d.%02d" ${cudacpp_major} ${cudacpp_minor} ${cudacpp_patch})
echo "(From CUDACPP_OUTPUT/__init__.py)" >> ${outfile}
echo "cudacpp_version = $(cat __init__.py | awk '/__version__/{print $3}' | sed 's/(//' | sed 's/)//' | sed 's/,/./g')" >> ${outfile}
echo "cudacpp_version = ${cudacpp_version}" >> ${outfile}
echo "mg5_version_minimal = $(cat __init__.py | awk '/minimal_mg5amcnlo_version/{print $3}' | sed 's/(//' | sed 's/)//' | sed 's/,/./g')" >> ${outfile}
echo "mg5_version_latest_validated = $(cat __init__.py | awk '/latest_validated_version/{print $3}' | sed 's/(//' | sed 's/)//' | sed 's/,/./g')" >> ${outfile}
echo "" >> ${outfile}
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/archiver.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ on:
push:

tags:
# Include version tags such as 'cudacpp_for3.6.0_v1.0.0' or 'cudacpp_for3.6.0_v1.0.0_test001'
# Include version tags such as 'valassi_cudacpp_for3.6.0_v1.0.0' or 'valassi_cudacpp_for3.6.0_v1.0.0_test001'
# Include version tags such as 'cudacpp_for3.6.0_v1.00.00' or 'cudacpp_for3.6.0_v1.00.00_test001'
# Include version tags such as 'valassi_cudacpp_for3.6.0_v1.00.00' or 'valassi_cudacpp_for3.6.0_v1.00.00_test001'
- '*cudacpp_for*_v*'

# Exclude running tags such as 'cudacpp_for3.6.0_latest'
Expand Down
4 changes: 2 additions & 2 deletions epochX/cudacpp/gitTag.sh
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ function usage()
{
echo "Usage (1): $0 [-f] <tagsuffix>"
echo "Creates a new version tag (from the HEAD of the local branch) and pushes it to the remote repository"
echo "Valid formats for <tagsuffix> are 'n1.n2.n3' or 'n1.n2.n3_txt' where txt only contains letters or digits"
echo "Version number 'n1.n2.n3' must match that in the CUDACPP_OUTPUT/__init__.py file"
echo "Valid formats for <tagsuffix> are 'n.nn.nn' or 'n.nn.nn_txt' where txt only contains letters or digits)"
echo "Version number must match the (n1,n2,n3) specified with single digits in the CUDACPP_OUTPUT/__init__.py file"
echo "For release tags (no trailing '_txt'), the github CI will then create also a running tag with '_latest' suffix"
echo "Use the -f option to delete and recreate a version tag that already exists"
echo ""
Expand Down

0 comments on commit acaef2c

Please sign in to comment.