Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit a34c788

Browse files
committedJun 23, 2023
Enable a different announcement for premium releases
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 #157
1 parent 988e13a commit a34c788

5 files changed

+85
-17
lines changed
 
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
2+
3+
OpenSSL version $release released
4+
=================================
5+
6+
OpenSSL - The Open Source toolkit for SSL/TLS
7+
https://www.openssl.org/
8+
9+
The OpenSSL project team is pleased to announce the release of
10+
version $release of our open source toolkit for SSL/TLS.
11+
12+
OpenSSL $release is available for download via HTTPS from the following
13+
location on our support system:
14+
15+
https://github.openssl.org/openssl/extended-releases/releases/tag/$release_tag
16+
17+
If you have not yet established access to our support system server,
18+
please contact us on osf-contact@openssl.org to arrange your set up.
19+
20+
The distribution file name is:
21+
22+
o $tarfile
23+
Size: $length
24+
SHA1 checksum: $sha1hash
25+
SHA256 checksum: $sha256hash
26+
27+
The checksums were calculated using the following commands:
28+
29+
openssl sha1 $tarfile
30+
openssl sha256 $tarfile
31+
32+
Yours,
33+
34+
The OpenSSL Project Team.
35+
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
#! /bin/bash
2+
# Copyright 2023 The OpenSSL Project Authors. All Rights Reserved.
3+
#
4+
# Licensed under the Apache License 2.0 (the "License"). You may not use
5+
# this file except in compliance with the License. You can obtain a copy
6+
# in the file LICENSE in the source distribution or at
7+
# https://www.openssl.org/source/license.html
8+
9+
# Public or premium release? Let the version numbers determine it!
10+
declare -A _ossl_release_types=(
11+
[premium]='^1\.0\.2'
12+
[public]='^(1\.1\.1|[3-9]\.)'
13+
)
14+
15+
std_release_type () {
16+
local v=$1
17+
local rt
18+
local re
19+
local release_type=
20+
21+
for rt in "${!_ossl_release_types[@]}"; do
22+
re="${_ossl_release_types[$rt]}"
23+
if [[ "$v" =~ $re ]]; then
24+
release_type=$rt
25+
break
26+
fi
27+
done
28+
echo $release_type
29+
}

‎release-tools/release-aux/release-version-fn.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
#
3535
# SERIES The current release series. It is computed from
3636
# MAJOR, MINOR and (possibly) FIX
37-
# VERSION The current version number. It is copmuted from
37+
# VERSION The current version number. It is computed from
3838
# MAJOR, MINOR, (possibly) FIX and PATCH
3939
# FULL_VERSION Like VERSION, but with metadata (PRE_RELEASE_TAG,
4040
# BUILD_METADATA) added

‎release-tools/stage-release.sh

+20-16
Original file line numberDiff line numberDiff line change
@@ -283,6 +283,7 @@ fi
283283
found=true
284284
for fn in "$RELEASE_AUX/release-version-fn.sh" \
285285
"$RELEASE_AUX/release-state-fn.sh" \
286+
"$RELEASE_AUX/release-data-fn.sh" \
286287
"$RELEASE_AUX/string-fn.sh" \
287288
"$RELEASE_AUX/upload-fn.sh"; do
288289
if ! [ -f "$fn" ]; then
@@ -297,6 +298,7 @@ fi
297298
# Load version functions
298299
. $RELEASE_AUX/release-version-fn.sh
299300
. $RELEASE_AUX/release-state-fn.sh
301+
. $RELEASE_AUX/release-data-fn.sh
300302
# Load string manipulation functions
301303
. $RELEASE_AUX/string-fn.sh
302304
# Load upload backend functions
@@ -532,10 +534,10 @@ update_branch=$(format_string "$branch_fmt" \
532534
"v=$FULL_VERSION")
533535

534536
# Make the release tag and branch name according to our current data
535-
tag=$(format_string "$tag_fmt" \
536-
"b=$orig_release_branch" \
537-
"t=$(std_tag_name)" \
538-
"v=$FULL_VERSION")
537+
release_tag=$(format_string "$tag_fmt" \
538+
"b=$orig_release_branch" \
539+
"t=$(std_tag_name)" \
540+
"v=$FULL_VERSION")
539541
release_branch=$(format_string "$branch_fmt" \
540542
"b=$orig_release_branch" \
541543
"t=$(std_tag_name)" \
@@ -599,8 +601,9 @@ if [ -n "$PRE_LABEL" ]; then
599601
release_text="$SERIES$_BUILD_METADATA $PRE_LABEL $PRE_NUM"
600602
announce_template=openssl-announce-pre-release.tmpl
601603
else
604+
release_type=$(std_release_type $VERSION)
602605
release_text="$release"
603-
announce_template=openssl-announce-release.tmpl
606+
announce_template=openssl-announce-release-$release_type.tmpl
604607
fi
605608
$VERBOSE "== Updated version information to $release"
606609

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

627630
tarfile=openssl-$release.tar
628631
tgzfile=$tarfile.gz
@@ -662,6 +665,7 @@ $VERBOSE "== Generating announcement text: $announce"
662665
# Hack the announcement template
663666
cat "$RELEASE_AUX/$announce_template" \
664667
| sed -e "s|\\\$release_text|$release_text|g" \
668+
-e "s|\\\$release_tag|$release_tag|g" \
665669
-e "s|\\\$release|$release|g" \
666670
-e "s|\\\$series|$SERIES|g" \
667671
-e "s|\\\$label|$PRE_LABEL|g" \
@@ -707,7 +711,7 @@ $VERBOSE "== Generating metadata file: $metadata"
707711
fi
708712
echo "release_branch='$orig_release_branch'"
709713
fi
710-
echo "release_tag='$tag'"
714+
echo "release_tag='$release_tag'"
711715
echo "upload_files='${staging_files[@]}'"
712716
echo "source_repo='$orig_remote_url'"
713717
) > ../$metadata
@@ -884,7 +888,7 @@ Push them to github, make PRs from them and have them approved.
884888
885889
Update branch: $update_branch
886890
Release branch: $release_branch
887-
Tag: $tag
891+
Tag: $release_tag
888892
889893
When merging everything into the main repository, do it like this:
890894
@@ -893,7 +897,7 @@ When merging everything into the main repository, do it like this:
893897
git push git@github.openssl.org:openssl/openssl.git \\
894898
$update_branch:$orig_update_branch
895899
git push git@github.openssl.org:openssl/openssl.git \\
896-
$tag
900+
$release_tag
897901
EOF
898902
elif [ "$update_branch" != "$orig_update_branch" ]; then
899903
# "Normal" scenario without --branch
@@ -903,14 +907,14 @@ repository. Push them to github, make PRs from them and have them
903907
approved.
904908
905909
Release/update branch: $update_branch
906-
Tag: $tag
910+
Tag: $release_tag
907911
908912
When merging everything into the main repository, do it like this:
909913
910914
git push git@github.openssl.org:openssl/openssl.git \\
911915
$update_branch:$orig_update_branch
912916
git push git@github.openssl.org:openssl/openssl.git \\
913-
$tag
917+
$release_tag
914918
EOF
915919
elif [ "$release_branch" != "$update_branch" ]; then
916920
# --clean-worktree and --branch scenario
@@ -921,7 +925,7 @@ PRs from them and have them approved:
921925
922926
Updated branch: $update_branch
923927
Release branch: $release_branch
924-
Tag: $tag
928+
Tag: $release_tag
925929
926930
When merging everything into the main repository, do it like this:
927931
@@ -930,7 +934,7 @@ When merging everything into the main repository, do it like this:
930934
git push git@github.openssl.org:openssl/openssl.git \\
931935
$update_branch
932936
git push git@github.openssl.org:openssl/openssl.git \\
933-
$tag
937+
$release_tag
934938
EOF
935939
else
936940
# --clean-worktree without --branch scenario
@@ -940,14 +944,14 @@ branch has been updated. Push them to github, make PRs from them and
940944
have them approved.
941945
942946
Release/update branch: $update_branch
943-
Tag: $tag
947+
Tag: $release_tag
944948
945949
When merging everything into the main repository, do it like this:
946950
947951
git push git@github.openssl.org:openssl/openssl.git \\
948952
$update_branch
949953
git push git@github.openssl.org:openssl/openssl.git \\
950-
$tag
954+
$release_tag
951955
EOF
952956
fi
953957

0 commit comments

Comments
 (0)
Please sign in to comment.