@@ -61,26 +61,41 @@ jobs:
61
61
echo "Current directory is $(pwd)"
62
62
echo "WORKDIR is ${WORKDIR}"
63
63
githubref=$${{ github.ref }}
64
- echo "(From github.ref) githubref = ${githubref}"
64
+ echo "(From github.ref) githubref = ${githubref}"
65
65
tagname=${githubref#/tags/}
66
- echo "(From github.ref) tagname = ${tagname}"
66
+ echo "(From github.ref) tagname = ${tagname}"
67
67
echo "TAGNAME=${tagname}" >> $GITHUB_ENV
68
- ###REPO=$${{ github.repository }}
69
- ###echo "REPO is ${REPO}" # owner is empty???
70
- ###OWNER=${REPO%/*}
71
- ###echo "OWNER is ${OWNER}" # owner is empty???
72
- ###TAGPREFIX=cudacpp_for
73
- ###if [ "${OWNER}" != "madgraph5" ]; then TAGPREFIX="${OWNER}_${TAGPREFIX}"; fi # TEMPORARY! this will change eventually...
68
+ REPOSITORY=$${{ github.repository }}
69
+ echo "(From github.repository) REPOSITORY = ${REPOSITORY}"
70
+ ###REPOOWNER=${REPOSITORY%/*} # owner is empty??
71
+ REPONAME=${REPOSITORY#*/} # owner is empty??
72
+ echo "(From github.repository) REPONAME = ${REPONAME}"
74
73
tmpsuffix=${tagname#*cudacpp_for}
75
74
TAGPREFIX=${tagname/${tmpsuffix}} # determine TAGPREFIX from triggering tag because github.repository_owner is empty(???)
76
- echo "TAGPREFIX is ${TAGPREFIX}"
75
+ echo "(From tagname) TAGPREFIX = ${TAGPREFIX}"
76
+ REPOOWNER=${TAGPREFIX%cudacpp_for}
77
+ if [ "${REPOOWNER}" == "${TAGPREFIX}" ]; then
78
+ echo "INTERNAL ERROR! Invalid TAGPREFIX '${TAGPREFIX}'" # does not end in 'cudacpp_for'?
79
+ exit 1
80
+ elif [ "${REPOOWNER}" == "" ]; then
81
+ REPOOWNER=madgraph5 # TEMPORARY! Will change eventually...
82
+ elif [ "${REPOOWNER%_}" != "${REPOOWNER}" ]; then
83
+ REPOOWNER=${REPOOWNER%_}
84
+ else
85
+ echo "INTERNAL ERROR! Invalid REPOOWNER '${REPOOWNER}'" # empty or does not end in '-'?
86
+ exit 1
87
+ fi
88
+ echo "(From tagname) REPOOWNER = ${REPOOWNER}"
89
+ REPOSITORY=${REPOOWNER}/${REPONAME}
90
+ echo "(From tagname) REPOSITORY = ${REPOSITORY}"
91
+ echo "REPOSITORY=${REPOSITORY}" >> $GITHUB_ENV
77
92
# Check version tag
78
93
cudacpp_version=$(cat ${WORKDIR}/VERSION.txt | awk '/^cudacpp_version/{print $3}')
79
94
mg5_version=$(cat ${WORKDIR}/VERSION.txt | awk '/^mg5_version_current/{print $3}')
80
- echo "(From VERSION.txt) cudacpp_version = ${cudacpp_version}"
81
- echo "(From VERSION.txt) mg5_version_current = ${mg5_version}"
95
+ echo "(From VERSION.txt) cudacpp_version = ${cudacpp_version}"
96
+ echo "(From VERSION.txt) mg5_version_current = ${mg5_version}"
82
97
tagname_version=${TAGPREFIX}${mg5_version}_v${cudacpp_version}
83
- echo "(From VERSION.txt) _expected_ tagname = ${tagname_version}[_...]"
98
+ echo "(From VERSION.txt) supported tagname = ${tagname_version}[_...]"
84
99
if [ "${tagname/${tagname_version}}" == "${tagname}" ]; then
85
100
echo "ERROR! Invalid tagname '${tagname}' does not start with '${tagname_version}'"
86
101
exit 1 # this will cause the job to fail without running the next steps
@@ -154,11 +169,11 @@ jobs:
154
169
echo "Current directory is now $(pwd)"
155
170
echo "Current branch is \"$(git branch | \grep ^* | sed 's/^* //')\""
156
171
tagname=${TAGNAME}
157
- echo "(From GITHUB_ENV) tagname = ${tagname}"
172
+ echo "(From GITHUB_ENV) tagname = ${tagname}"
158
173
tagname_latest=${TAGNAME_LATEST}
159
- echo "(From GITHUB_ENV) tagname_latest = ${tagname_latest}"
174
+ echo "(From GITHUB_ENV) tagname_latest = ${tagname_latest}"
160
175
commit=$(cat ${WORKDIR}/VERSION.txt | awk '/^commit/{print $2}')
161
- echo "(From VERSION.txt) commit = ${commit}"
176
+ echo "(From VERSION.txt) commit = ${commit}"
162
177
# Create running tag
163
178
git config user.name github-actions
164
179
git config user.email github-actions@github.com
@@ -209,9 +224,8 @@ jobs:
209
224
cd branch_PR
210
225
echo "Current directory is now $(pwd)"
211
226
echo "Current branch is \"$(git branch | \grep ^* | sed 's/^* //')\""
212
- REPO=$${{ github.repository }}
213
- echo "REPO is ${REPO}"
214
- python3 .github/workflows/archiver.py ${REPO} version_info.dat
227
+ echo "(From GITHUB_ENV) REPOSITORY = ${REPOSITORY}"
228
+ python3 .github/workflows/archiver.py ${REPOSITORY} version_info.dat
215
229
mv version_info.dat ${WORKDIR}
216
230
echo "Created version_info.dat"
217
231
python3 -c 'print("-"*132)'
0 commit comments