Skip to content

Commit

Permalink
tools: check for git tag before promoting release
Browse files Browse the repository at this point in the history
PR-URL: nodejs#24670
Reviewed-By: Daniel Bevenius <[email protected]>
Reviewed-By: James M Snell <[email protected]>
  • Loading branch information
rvagg authored and refack committed Jan 10, 2019
1 parent 6500f9c commit e32ad9f
Showing 1 changed file with 12 additions and 6 deletions.
18 changes: 12 additions & 6 deletions tools/release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,14 @@ fi
echo "Using GPG key: $gpgkey"
echo " Fingerprint: $gpgfing"

function checktag {
local version=$1

if ! git tag -v $version 2>&1 | grep "${gpgkey}" | grep key > /dev/null; then
echo "Could not find signed tag for \"${version}\" or GPG key is not yours"
exit 1
fi
}

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

local version=$1

if ! git tag -v $version 2>&1 | grep "${gpgkey}" | grep key > /dev/null; then
echo "Could not find signed tag for \"${version}\" or GPG key is not yours"
exit 1
fi

ghtaggedversion=$(curl -sL https://raw.githubusercontent.com/nodejs/node/${version}/src/node_version.h \
| awk '/define NODE_(MAJOR|MINOR|PATCH)_VERSION/{ v = v "." $3 } END{ v = "v" substr(v, 2); print v }')
if [ "${version}" != "${ghtaggedversion}" ]; then
Expand Down Expand Up @@ -150,7 +153,8 @@ function sign {


if [ -n "${signversion}" ]; then
sign ${signversion}
checktag $signversion
sign $signversion
exit 0
fi

Expand Down Expand Up @@ -192,6 +196,8 @@ for version in $versions; do
continue
fi

checktag $version

echo -e "\n# Promoting ${version}..."

ssh ${customsshkey} ${webuser}@${webhost} $promotecmd nodejs $version
Expand Down

0 comments on commit e32ad9f

Please sign in to comment.