Skip to content

Commit 2ef6aed

Browse files
rvaggBridgeAR
authored andcommitted
tools: check for git tag before promoting release
PR-URL: #24670 Reviewed-By: Daniel Bevenius <daniel.bevenius@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
1 parent 193f315 commit 2ef6aed

File tree

1 file changed

+12
-6
lines changed

1 file changed

+12
-6
lines changed

tools/release.sh

+12-6
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,14 @@ fi
8181
echo "Using GPG key: $gpgkey"
8282
echo " Fingerprint: $gpgfing"
8383

84+
function checktag {
85+
local version=$1
86+
87+
if ! git tag -v $version 2>&1 | grep "${gpgkey}" | grep key > /dev/null; then
88+
echo "Could not find signed tag for \"${version}\" or GPG key is not yours"
89+
exit 1
90+
fi
91+
}
8492

8593
################################################################################
8694
## Create and sign checksums file for a given version
@@ -90,11 +98,6 @@ function sign {
9098

9199
local version=$1
92100

93-
if ! git tag -v $version 2>&1 | grep "${gpgkey}" | grep key > /dev/null; then
94-
echo "Could not find signed tag for \"${version}\" or GPG key is not yours"
95-
exit 1
96-
fi
97-
98101
ghtaggedversion=$(curl -sL https://raw.githubusercontent.com/nodejs/node/${version}/src/node_version.h \
99102
| awk '/define NODE_(MAJOR|MINOR|PATCH)_VERSION/{ v = v "." $3 } END{ v = "v" substr(v, 2); print v }')
100103
if [ "${version}" != "${ghtaggedversion}" ]; then
@@ -150,7 +153,8 @@ function sign {
150153

151154

152155
if [ -n "${signversion}" ]; then
153-
sign ${signversion}
156+
checktag $signversion
157+
sign $signversion
154158
exit 0
155159
fi
156160

@@ -192,6 +196,8 @@ for version in $versions; do
192196
continue
193197
fi
194198

199+
checktag $version
200+
195201
echo -e "\n# Promoting ${version}..."
196202

197203
ssh ${customsshkey} ${webuser}@${webhost} $promotecmd nodejs $version

0 commit comments

Comments
 (0)