Skip to content

Commit

Permalink
Enable a different announcement for premium releases
Browse files Browse the repository at this point in the history
The basic data of what is considered premium and what is considered
public releases, a new bash function is added, std_release_type(), found in
release-tools/release-aux/release-data-fn.sh.

Along with this, the non-descript variable 'tag' is renamed to 'release_tag',
and a spelling error is corrected.

Fixes openssl#157
  • Loading branch information
levitte committed Jun 23, 2023
1 parent 988e13a commit a34c788
Show file tree
Hide file tree
Showing 5 changed files with 85 additions and 17 deletions.
35 changes: 35 additions & 0 deletions release-tools/release-aux/openssl-announce-release-premium.tmpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@


OpenSSL version $release released
=================================

OpenSSL - The Open Source toolkit for SSL/TLS
https://www.openssl.org/

The OpenSSL project team is pleased to announce the release of
version $release of our open source toolkit for SSL/TLS.

OpenSSL $release is available for download via HTTPS from the following
location on our support system:

https://github.openssl.org/openssl/extended-releases/releases/tag/$release_tag

If you have not yet established access to our support system server,
please contact us on [email protected] to arrange your set up.

The distribution file name is:

o $tarfile
Size: $length
SHA1 checksum: $sha1hash
SHA256 checksum: $sha256hash

The checksums were calculated using the following commands:

openssl sha1 $tarfile
openssl sha256 $tarfile

Yours,

The OpenSSL Project Team.

29 changes: 29 additions & 0 deletions release-tools/release-aux/release-data-fn.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
#! /bin/bash
# Copyright 2023 The OpenSSL Project Authors. All Rights Reserved.
#
# Licensed under the Apache License 2.0 (the "License"). You may not use
# this file except in compliance with the License. You can obtain a copy
# in the file LICENSE in the source distribution or at
# https://www.openssl.org/source/license.html

# Public or premium release? Let the version numbers determine it!
declare -A _ossl_release_types=(
[premium]='^1\.0\.2'
[public]='^(1\.1\.1|[3-9]\.)'
)

std_release_type () {
local v=$1
local rt
local re
local release_type=

for rt in "${!_ossl_release_types[@]}"; do
re="${_ossl_release_types[$rt]}"
if [[ "$v" =~ $re ]]; then
release_type=$rt
break
fi
done
echo $release_type
}
2 changes: 1 addition & 1 deletion release-tools/release-aux/release-version-fn.sh
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
#
# SERIES The current release series. It is computed from
# MAJOR, MINOR and (possibly) FIX
# VERSION The current version number. It is copmuted from
# VERSION The current version number. It is computed from
# MAJOR, MINOR, (possibly) FIX and PATCH
# FULL_VERSION Like VERSION, but with metadata (PRE_RELEASE_TAG,
# BUILD_METADATA) added
Expand Down
36 changes: 20 additions & 16 deletions release-tools/stage-release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -283,6 +283,7 @@ fi
found=true
for fn in "$RELEASE_AUX/release-version-fn.sh" \
"$RELEASE_AUX/release-state-fn.sh" \
"$RELEASE_AUX/release-data-fn.sh" \
"$RELEASE_AUX/string-fn.sh" \
"$RELEASE_AUX/upload-fn.sh"; do
if ! [ -f "$fn" ]; then
Expand All @@ -297,6 +298,7 @@ fi
# Load version functions
. $RELEASE_AUX/release-version-fn.sh
. $RELEASE_AUX/release-state-fn.sh
. $RELEASE_AUX/release-data-fn.sh
# Load string manipulation functions
. $RELEASE_AUX/string-fn.sh
# Load upload backend functions
Expand Down Expand Up @@ -532,10 +534,10 @@ update_branch=$(format_string "$branch_fmt" \
"v=$FULL_VERSION")

# Make the release tag and branch name according to our current data
tag=$(format_string "$tag_fmt" \
"b=$orig_release_branch" \
"t=$(std_tag_name)" \
"v=$FULL_VERSION")
release_tag=$(format_string "$tag_fmt" \
"b=$orig_release_branch" \
"t=$(std_tag_name)" \
"v=$FULL_VERSION")
release_branch=$(format_string "$branch_fmt" \
"b=$orig_release_branch" \
"t=$(std_tag_name)" \
Expand Down Expand Up @@ -599,8 +601,9 @@ if [ -n "$PRE_LABEL" ]; then
release_text="$SERIES$_BUILD_METADATA $PRE_LABEL $PRE_NUM"
announce_template=openssl-announce-pre-release.tmpl
else
release_type=$(std_release_type $VERSION)
release_text="$release"
announce_template=openssl-announce-release.tmpl
announce_template=openssl-announce-release-$release_type.tmpl
fi
$VERBOSE "== Updated version information to $release"

Expand All @@ -621,8 +624,8 @@ git commit $git_quiet -m "Prepare for release of $release_text"$'\n\nRelease: ye
if [ -n "$reviewers" ]; then
addrev --release --nopr $reviewers
fi
$ECHO "Tagging release with tag $tag. You may need to enter a pass phrase"
git tag$tagkey "$tag" -m "OpenSSL $release release tag"
$ECHO "Tagging release with tag $release_tag. You may need to enter a pass phrase"
git tag$tagkey "$release_tag" -m "OpenSSL $release release tag"

tarfile=openssl-$release.tar
tgzfile=$tarfile.gz
Expand Down Expand Up @@ -662,6 +665,7 @@ $VERBOSE "== Generating announcement text: $announce"
# Hack the announcement template
cat "$RELEASE_AUX/$announce_template" \
| sed -e "s|\\\$release_text|$release_text|g" \
-e "s|\\\$release_tag|$release_tag|g" \
-e "s|\\\$release|$release|g" \
-e "s|\\\$series|$SERIES|g" \
-e "s|\\\$label|$PRE_LABEL|g" \
Expand Down Expand Up @@ -707,7 +711,7 @@ $VERBOSE "== Generating metadata file: $metadata"
fi
echo "release_branch='$orig_release_branch'"
fi
echo "release_tag='$tag'"
echo "release_tag='$release_tag'"
echo "upload_files='${staging_files[@]}'"
echo "source_repo='$orig_remote_url'"
) > ../$metadata
Expand Down Expand Up @@ -884,7 +888,7 @@ Push them to github, make PRs from them and have them approved.
Update branch: $update_branch
Release branch: $release_branch
Tag: $tag
Tag: $release_tag
When merging everything into the main repository, do it like this:
Expand All @@ -893,7 +897,7 @@ When merging everything into the main repository, do it like this:
git push [email protected]:openssl/openssl.git \\
$update_branch:$orig_update_branch
git push [email protected]:openssl/openssl.git \\
$tag
$release_tag
EOF
elif [ "$update_branch" != "$orig_update_branch" ]; then
# "Normal" scenario without --branch
Expand All @@ -903,14 +907,14 @@ repository. Push them to github, make PRs from them and have them
approved.
Release/update branch: $update_branch
Tag: $tag
Tag: $release_tag
When merging everything into the main repository, do it like this:
git push [email protected]:openssl/openssl.git \\
$update_branch:$orig_update_branch
git push [email protected]:openssl/openssl.git \\
$tag
$release_tag
EOF
elif [ "$release_branch" != "$update_branch" ]; then
# --clean-worktree and --branch scenario
Expand All @@ -921,7 +925,7 @@ PRs from them and have them approved:
Updated branch: $update_branch
Release branch: $release_branch
Tag: $tag
Tag: $release_tag
When merging everything into the main repository, do it like this:
Expand All @@ -930,7 +934,7 @@ When merging everything into the main repository, do it like this:
git push [email protected]:openssl/openssl.git \\
$update_branch
git push [email protected]:openssl/openssl.git \\
$tag
$release_tag
EOF
else
# --clean-worktree without --branch scenario
Expand All @@ -940,14 +944,14 @@ branch has been updated. Push them to github, make PRs from them and
have them approved.
Release/update branch: $update_branch
Tag: $tag
Tag: $release_tag
When merging everything into the main repository, do it like this:
git push [email protected]:openssl/openssl.git \\
$update_branch
git push [email protected]:openssl/openssl.git \\
$tag
$release_tag
EOF
fi

Expand Down

0 comments on commit a34c788

Please sign in to comment.