Skip to content

Commit

Permalink
[install] add a release.sh script to create unique and running releas…
Browse files Browse the repository at this point in the history
…e tags
  • Loading branch information
valassi committed Sep 26, 2024
1 parent 53e2c49 commit 01daafb
Showing 1 changed file with 43 additions and 0 deletions.
43 changes: 43 additions & 0 deletions epochX/cudacpp/release.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
#!/bin/bash
# Copyright (C) 2020-2024 CERN and UCLouvain.
# Licensed under the GNU Lesser General Public License (version 3 or later).
# Created by: A. Valassi (Sep 2024) for the MG5aMC CUDACPP plugin.
# Further modified by: A. Valassi (2024) for the MG5aMC CUDACPP plugin.

set -e # fail on error

topdir=$(cd $(dirname $0)/../..; pwd)

# The remote repo used for tagging
REMOTE=origin

# The branch name used for tagging
BRANCH=${REMOTE}/install # temporary! it should be master eventually...

# Determine mg5_version (as in HEPToolInstaller.py)
fVERSION=${topdir}/MG5aMC/mg5amcnlo/VERSION
if [ ! -f ${fVERSION} ]; then echo "ERROR! File ${fVERSION} not found"; exit 1; fi
VERSION=$(python3 -c "import re; print(re.findall(r'version\s*=\s*([\.\d]*)','$(cat ${fVERSION} | grep ^version)')[0])")
###echo $VERSION

# Determine UTC date
DATE=$(date -u +on%y%m%d_at%H%M%S)
###echo $DATE

# Build the unique and running tag names
PREFIX=TEST_cudacpp
uniqTAG=${PREFIX}_for${VERSION}_${DATE}
runnTAG=${PREFIX}_for${VERSION}_latest
echo ${uniqTAG}
echo ${runnTAG}

# Create the unique (~permanent) tag
git tag ${uniqTAG} ${BRANCH} -m "Unique tag ${uniqTAG}"

# Create the running tag
# (use '-f' to replace any previously existing tag with the same name)
git tag -f ${runnTAG} ${uniqTAG} -m "Running tag ${runnTAG} (linked to unique tag ${uniqTAG})"

# Push the tags to the remote repository
# (use '-f' to replace any previously existing tag with the same name)
git push -f ${REMOTE} --tags

0 comments on commit 01daafb

Please sign in to comment.