release-tools/release.sh et al: introduce FULL_VERSION and use it
[tools.git] / release-tools / release.sh
1 #! /bin/bash -e
2 # Copyright 2020-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 # This is the most shell agnostic way to specify that POSIX rules.
10 POSIXLY_CORRECT=1
11
12 # Force C locale because some commands (like date +%b) relies
13 # on the current locale.
14 export LC_ALL=C
15
16 usage () {
17     cat <<EOF
18 Usage: release.sh [ options ... ]
19
20 --alpha         Start or increase the "alpha" pre-release tag.
21 --next-beta     Switch to the "beta" pre-release tag after alpha release.
22                 It can only be given with --alpha.
23 --beta          Start or increase the "beta" pre-release tag.
24 --final         Get out of "alpha" or "beta" and make a final release.
25                 Implies --branch.
26
27 --branch        Create a release branch 'openssl-{major}.{minor}',
28                 where '{major}' and '{minor}' are the major and minor
29                 version numbers.
30
31 --reviewer=<id> The reviewer of the commits.
32 --local-user=<keyid>
33                 For the purpose of signing tags and tar files, use this
34                 key (default: use the default e-mail address’ key).
35
36 --no-upload     Don't upload to upload@dev.openssl.org.
37 --no-update     Don't perform 'make update' and 'make update-fips-checksums'.
38 --verbose       Verbose output.
39 --debug         Include debug output.  Implies --no-upload.
40
41 --force         Force execution
42
43 --help          This text
44 --manual        The manual
45
46 If none of --alpha, --beta, or --final are given, this script tries to
47 figure out the next step.
48 EOF
49     exit 0
50 }
51
52 # Set to one of 'major', 'minor', 'alpha', 'beta' or 'final'
53 next_method=
54 next_method2=
55
56 do_branch=false
57 warn_branch=false
58
59 do_clean=true
60 do_upload=true
61 do_update=true
62 DEBUG=:
63 VERBOSE=:
64 git_quiet=-q
65
66 force=false
67
68 do_help=false
69 do_manual=false
70
71 tagkey=' -s'
72 gpgkey=
73 reviewers=
74
75 upload_address=upload@dev.openssl.org
76
77 TEMP=$(getopt -l 'alpha,next-beta,beta,final' \
78               -l 'branch' \
79               -l 'no-upload,no-update' \
80               -l 'verbose,debug' \
81               -l 'local-user:' \
82               -l 'reviewer:' \
83               -l 'force' \
84               -l 'help,manual' \
85               -n release.sh -- - "$@")
86 eval set -- "$TEMP"
87 while true; do
88     case $1 in
89     --alpha | --beta | --final )
90         next_method=$(echo "x$1" | sed -e 's|^x--||')
91         if [ -z "$next_method2" ]; then
92             next_method2=$next_method
93         fi
94         shift
95         if [ "$next_method" = 'final' ]; then
96             do_branch=true
97         fi
98         ;;
99     --next-beta )
100         next_method2=$(echo "x$1" | sed -e 's|^x--next-||')
101         shift
102         ;;
103     --branch )
104         do_branch=true
105         warn_branch=true
106         shift
107         ;;
108     --no-upload )
109         do_upload=false
110         shift
111         ;;
112     --no-update )
113         do_update=false
114         shift
115         ;;
116     --verbose )
117         VERBOSE=echo
118         git_quiet=
119         shift
120         ;;
121     --debug )
122         DEBUG=echo
123         do_upload=false
124         shift
125         ;;
126     --local-user )
127         shift
128         tagkey=" -u $1"
129         gpgkey=" -u $1"
130         shift
131         ;;
132     --reviewer )
133         reviewers="$reviewers $1=$2"
134         shift
135         shift
136         ;;
137     --force )
138         force=true
139         shift
140         ;;
141     --help )
142         usage
143         exit 0
144         ;;
145     --manual )
146         sed -e '1,/^### BEGIN MANUAL/d' \
147             -e '/^### END MANUAL/,$d' \
148             < "$0" \
149             | pod2man \
150             | man -l -
151         exit 0
152         ;;
153     -- )
154         shift
155         break
156         ;;
157     * )
158         echo >&2 "Unknown option $1"
159         shift
160         exit 1
161         ;;
162     esac
163 done
164
165 $DEBUG >&2 "DEBUG: \$next_method=$next_method"
166 $DEBUG >&2 "DEBUG: \$next_method2=$next_method2"
167
168 $DEBUG >&2 "DEBUG: \$do_branch=$do_branch"
169
170 $DEBUG >&2 "DEBUG: \$do_upload=$do_upload"
171 $DEBUG >&2 "DEBUG: \$do_update=$do_update"
172 $DEBUG >&2 "DEBUG: \$DEBUG=$DEBUG"
173 $DEBUG >&2 "DEBUG: \$VERBOSE=$VERBOSE"
174 $DEBUG >&2 "DEBUG: \$git_quiet=$git_quiet"
175
176 case "$next_method+$next_method2" in
177     major+major | minor+minor )
178         # These are expected
179         ;;
180     alpha+alpha | alpha+beta | beta+beta | final+final | + | +beta )
181         # These are expected
182         ;;
183     * )
184         echo >&2 "Internal option error ($next_method, $next_method2)"
185         exit 1
186         ;;
187 esac
188
189 # Verbosity feed for certain commands
190 VERBOSITY_FIFO=/tmp/openssl-$$.fifo
191 mkfifo -m 600 $VERBOSITY_FIFO
192 ( cat $VERBOSITY_FIFO | while read L; do $VERBOSE "> $L"; done ) &
193 exec 42>$VERBOSITY_FIFO
194 trap "exec 42>&-; rm $VERBOSITY_FIFO" 0 2
195
196 # Setup ##############################################################
197
198 # Check that we have the scripts that define functions we use
199 RELEASE_AUX=$(cd $(dirname $0)/release-aux; pwd)
200 found=true
201 for fn in "$RELEASE_AUX/release-version-fn.sh" \
202           "$RELEASE_AUX/release-state-fn.sh"; do
203     if ! [ -f "$fn" ]; then
204         echo >&2 "'$fn' is missing"
205         found=false
206     fi
207 done
208 if ! $found; then
209     exit 1
210 fi
211
212 # Load version functions
213 . $RELEASE_AUX/release-version-fn.sh
214 . $RELEASE_AUX/release-state-fn.sh
215
216 # Make sure we're in the work directory, and remember it
217 if HERE=$(git rev-parse --show-toplevel); then
218     :
219 else
220     echo >&2 "Not in a git worktree"
221     exit 1
222 fi
223
224 # Make sure that it's a plausible OpenSSL work tree, by checking
225 # that a version file is found
226 get_version
227
228 if [ -z "$VERSION_FILE" ]; then
229     echo >&2 "Couldn't find OpenSSL version data"
230     exit 1
231 fi
232
233 # Make sure it's a branch we recognise
234 orig_branch=$(git rev-parse --abbrev-ref HEAD)
235 if (echo "$orig_branch" \
236         | grep -E -q \
237                -e '^master$' \
238                -e '^OpenSSL_[0-9]+_[0-9]+_[0-9]+[a-z]*-stable$' \
239                -e '^openssl-[0-9]+\.[0-9]+$'); then
240     :
241 elif $force; then
242     :
243 else
244     echo >&2 "Not in master or any recognised release branch"
245     echo >&2 "Please 'git checkout' an appropriate branch"
246     exit 1
247 fi
248 orig_HEAD=$(git rev-parse HEAD)
249
250 # Initialize #########################################################
251
252 echo "== Initializing work tree"
253
254 # Generate a cloned directory name
255 release_clone="$orig_branch-release-tmp"
256
257 echo "== Work tree will be in $release_clone"
258
259 # Make a clone in a subdirectory and move there
260 if ! [ -d "$release_clone" ]; then
261     $VERBOSE "== Cloning to $release_clone"
262     git clone $git_quiet -b "$orig_branch" -o parent . "$release_clone"
263 fi
264 cd "$release_clone"
265
266 get_version
267
268 # Branches we will work with.  The release branch is where we make the
269 # changes for the release, the update branch is where we make the post-
270 # release changes
271 update_branch="$orig_branch"
272 release_branch="$(std_branch_name)"
273
274 # among others, we only create a release branch if the patch number is zero
275 if [ "$update_branch" = "$release_branch" ] || [ $PATCH -ne 0 ]; then
276     if $do_branch && $warn_branch; then
277         echo >&2 "Warning! We're already in a release branch; --branch ignored"
278     fi
279     do_branch=false
280 fi
281
282 if ! $do_branch; then
283     release_branch="$update_branch"
284 fi
285
286 # Branches we create for PRs
287 branch_version="$VERSION${PRE_LABEL:+-$PRE_LABEL$PRE_NUM}"
288 tmp_update_branch="OSSL--$update_branch--$branch_version"
289 tmp_release_branch="OSSL--$release_branch--$branch_version"
290
291 # Check that we're still on the same branch as our parent repo, or on a
292 # release branch
293 current_branch=$(git rev-parse --abbrev-ref HEAD)
294 if [ "$current_branch" = "$update_branch" ]; then
295     :
296 elif [ "$current_branch" = "$release_branch" ]; then
297     :
298 else
299     echo >&2 "The cloned sub-directory '$release_clone' is on a branch"
300     if [ "$update_branch" = "$release_branch" ]; then
301         echo >&2 "other than '$update_branch'."
302     else
303         echo >&2 "other than '$update_branch' or '$release_branch'."
304     fi
305     echo >&2 "Please 'cd \"$(pwd)\"; git checkout $update_branch'"
306     exit 1
307 fi
308
309 SOURCEDIR=$(pwd)
310 $DEBUG >&2 "DEBUG: Source directory is $SOURCEDIR"
311
312 # Release ############################################################
313
314 # We always expect to start from a state of development
315 if [ "$TYPE" != 'dev' ]; then
316     echo >&2 "Not in a development branch"
317     echo >&2 "Have a look at the git log in $release_clone, it may be that"
318     echo >&2 "a previous crash left it in an intermediate state and that"
319     echo >&2 "need to drop the top commit:"
320     echo >&2 ""
321     echo >&2 "(cd $release_clone; git reset --hard HEAD^)"
322     echo >&2 "# WARNING! LOOK BEFORE YOU ACT"
323     exit 1
324 fi
325
326 # Update the version information.  This won't save anything anywhere, yet,
327 # but does check for possible next_method errors before we do bigger work.
328 next_release_state "$next_method"
329
330 # Create our temporary release branch
331 $VERBOSE "== Creating a local release branch: $tmp_release_branch"
332 git checkout $git_quiet -b "$tmp_release_branch"
333
334 echo "== Configuring OpenSSL for update and release.  This may take a bit of time"
335
336 ./Configure cc >&42
337
338 $VERBOSE "== Checking source file updates and fips checksums"
339
340 make update >&42
341 # As long as we're doing an alpha release, we can have symbols without specific
342 # numbers assigned. In a beta or final release, all symbols MUST have an
343 # assigned number.
344 if [ "$next_method" != 'alpha' ]; then
345     make renumber >&42
346 fi
347 make update-fips-checksums >&42
348
349 if [ -n "$(git status --porcelain)" ]; then
350     $VERBOSE "== Committing updates"
351     git add -u
352     git commit $git_quiet -m $'make update\n\nRelease: yes'
353     if [ -n "$reviewers" ]; then
354         addrev --release --nopr $reviewers
355     fi
356 fi
357
358 # Create our temporary update branch, if it's not the release branch.
359 # This is used in post-release below
360 if $do_branch; then
361     $VERBOSE "== Creating a local update branch: $tmp_update_branch"
362     git branch $git_quiet "$tmp_update_branch"
363 fi
364
365 # Write the version information we updated
366 set_version
367
368 release="$FULL_VERSION"
369 if [ -n "$PRE_LABEL" ]; then
370     release_text="$SERIES$_BUILD_METADATA $PRE_LABEL $PRE_NUM"
371     announce_template=openssl-announce-pre-release.tmpl
372 else
373     release_text="$release"
374     announce_template=openssl-announce-release.tmpl
375 fi
376 tag="$(std_tag_name)"
377 $VERBOSE "== Updated version information to $release"
378
379 $VERBOSE "== Updating files with release date for $release : $RELEASE_DATE"
380 for fixup in "$RELEASE_AUX"/fixup-*-release.pl; do
381     file="$(basename "$fixup" | sed -e 's|^fixup-||' -e 's|-release\.pl$||')"
382     $VERBOSE "> $file"
383     RELEASE="$release" RELEASE_TEXT="$release_text" RELEASE_DATE="$RELEASE_DATE" \
384         perl -pi $fixup $file
385 done
386
387 $VERBOSE "== Committing updates and tagging"
388 git add -u
389 git commit $git_quiet -m "Prepare for release of $release_text"$'\n\nRelease: yes'
390 if [ -n "$reviewers" ]; then
391     addrev --release --nopr $reviewers
392 fi
393 echo "Tagging release with tag $tag.  You may need to enter a pass phrase"
394 git tag$tagkey "$tag" -m "OpenSSL $release release tag"
395
396 tarfile=openssl-$release.tar
397 tgzfile=$tarfile.gz
398 announce=openssl-$release.txt
399
400 echo "== Generating tar, hash and announcement files.  This make take a bit of time"
401
402 $VERBOSE "== Making tarfile: $tgzfile"
403 # Unfortunately, util/mktar.sh does verbose output on STDERR...  for good
404 # reason, but it means we don't display errors unless --verbose
405 ./util/mktar.sh --tarfile="../$tarfile" 2>&1 \
406     | while read L; do $VERBOSE "> $L"; done
407
408 if ! [ -f "../$tgzfile" ]; then
409     echo >&2 "Where did the tarball end up? (../$tgzfile)"
410     exit 1
411 fi
412
413 $VERBOSE "== Generating checksums: $tgzfile.sha1 $tgzfile.sha256"
414 openssl sha1 < "../$tgzfile" | \
415     (IFS='='; while read X H; do echo $H; done) > "../$tgzfile.sha1"
416 openssl sha256 < "../$tgzfile" | \
417     (IFS='='; while read X H; do echo $H; done) > "../$tgzfile.sha256"
418 length=$(wc -c < "../$tgzfile")
419 sha1hash=$(cat "../$tgzfile.sha1")
420 sha256hash=$(cat "../$tgzfile.sha256")
421
422 $VERBOSE "== Generating announcement text: $announce"
423 # Hack the announcement template
424 cat "$RELEASE_AUX/$announce_template" \
425     | sed -e "s|\\\$release_text|$release_text|g" \
426           -e "s|\\\$release|$release|g" \
427           -e "s|\\\$series|$SERIES|g" \
428           -e "s|\\\$label|$PRE_LABEL|g" \
429           -e "s|\\\$tarfile|$tgzfile|" \
430           -e "s|\\\$length|$length|" \
431           -e "s|\\\$sha1hash|$sha1hash|" \
432           -e "s|\\\$sha256hash|$sha256hash|" \
433     | perl -p "$RELEASE_AUX/fix-title.pl" \
434     > "../$announce"
435
436 $VERBOSE "== Generating signatures: $tgzfile.asc $announce.asc"
437 rm -f "../$tgzfile.asc" "../$announce.asc"
438 echo "Signing the release files.  You may need to enter a pass phrase"
439 gpg$gpgkey --use-agent -sba "../$tgzfile"
440 gpg$gpgkey --use-agent -sta --clearsign "../$announce"
441
442 # Push everything to the parent repo
443 $VERBOSE "== Push what we have to the parent repository"
444 git push --follow-tags parent HEAD
445
446 if $do_upload; then
447     (
448         if [ "$VERBOSE" != ':' ]; then
449             echo "progress"
450         fi
451         echo "put ../$tgzfile"
452         echo "put ../$tgzfile.sha1"
453         echo "put ../$tgzfile.sha256"
454         echo "put ../$tgzfile.asc"
455         echo "put ../$announce.asc"
456     ) \
457     | sftp "$upload_address"
458 fi
459
460 # Post-release #######################################################
461
462 $VERBOSE "== Reset all files to their pre-release contents"
463 git reset $git_quiet HEAD^ -- .
464 git checkout -- .
465
466 prev_release_text="$release_text"
467 prev_release_date="$RELEASE_DATE"
468
469 next_release_state "$next_method2"
470 set_version
471
472 release="$FULL_VERSION"
473 release_text="$VERSION$_BUILD_METADATA"
474 if [ -n "$PRE_LABEL" ]; then
475     release_text="$SERIES$_BUILD_METADATA $PRE_LABEL $PRE_NUM"
476 fi
477 $VERBOSE "== Updated version information to $release"
478
479 $VERBOSE "== Updating files for $release :"
480 for fixup in "$RELEASE_AUX"/fixup-*-postrelease.pl; do
481     file="$(basename "$fixup" | sed -e 's|^fixup-||' -e 's|-postrelease\.pl$||')"
482     $VERBOSE "> $file"
483     RELEASE="$release" RELEASE_TEXT="$release_text" \
484         PREV_RELEASE_TEXT="$prev_release_text" \
485         PREV_RELEASE_DATE="$prev_release_date" \
486         perl -pi $fixup $file
487 done
488
489 $VERBOSE "== Committing updates"
490 git add -u
491 git commit $git_quiet -m "Prepare for $release_text"$'\n\nRelease: yes'
492 if [ -n "$reviewers" ]; then
493     addrev --release --nopr $reviewers
494 fi
495
496 # Push everything to the parent repo
497 $VERBOSE "== Push what we have to the parent repository"
498 git push parent HEAD
499
500 if $do_branch; then
501     $VERBOSE "== Going back to the update branch $tmp_update_branch"
502     git checkout $git_quiet "$tmp_update_branch"
503
504     get_version
505     next_release_state "minor"
506     set_version
507
508     release="$FULL_VERSION"
509     release_text="$SERIES$_BUILD_METADATA"
510     $VERBOSE "== Updated version information to $release"
511
512     $VERBOSE "== Updating files for $release :"
513     for fixup in "$RELEASE_AUX"/fixup-*-postrelease.pl; do
514         file="$(basename "$fixup" | sed -e 's|^fixup-||' -e 's|-postrelease\.pl$||')"
515         $VERBOSE "> $file"
516         RELEASE="$release" RELEASE_TEXT="$release_text" \
517             perl -pi $fixup $file
518     done
519
520     $VERBOSE "== Committing updates"
521     git add -u
522     git commit $git_quiet -m "Prepare for $release_text"$'\n\nRelease: yes'
523     if [ -n "$reviewers" ]; then
524         addrev --release --nopr $reviewers
525     fi
526 fi
527
528 # Push everything to the parent repo
529 $VERBOSE "== Push what we have to the parent repository"
530 git push parent HEAD
531
532 # Done ###############################################################
533
534 $VERBOSE "== Done"
535
536 cd $HERE
537 cat <<EOF
538
539 ======================================================================
540 The release is done, and involves a few files and commits for you to
541 deal with.  Everything you need has been pushed to your repository,
542 please see instructions that follow.
543 ======================================================================
544
545 EOF
546
547 if $do_release; then
548     cat <<EOF
549
550 The following files were uploaded to $upload_address, please ensure they
551 are dealt with appropriately:
552
553     $tgzfile
554     $tgzfile.sha1
555     $tgzfile.sha256
556     $tgzfile.asc
557     $announce.asc
558 EOF
559 fi
560
561 cat <<EOF
562
563 ----------------------------------------------------------------------
564 EOF
565
566 if $do_branch; then
567     cat <<EOF
568 You need to prepare the main repository with a new branch, '$release_branch'.
569 That is done directly in the server's bare repository like this:
570
571     git branch $release_branch $orig_HEAD
572
573 Two additional release branches have been added to your repository.
574 Push them to github, make PRs from them and have them approved:
575
576     $tmp_update_branch
577     $tmp_release_branch
578
579 When merging them into the main repository, do it like this:
580
581     git push git@github.openssl.org:openssl/openssl.git \\
582         $tmp_release_branch:$release_branch
583     git push git@github.openssl.org:openssl/openssl.git \\
584         $tmp_update_branch:$update_branch
585     git push git@github.openssl.org:openssl/openssl.git \\
586         $tag
587 EOF
588 else
589 cat <<EOF
590 One additional release branch has been added to your repository.
591 Push it to github, make a PR from it and have it approved:
592
593     $tmp_release_branch
594
595 When merging it into the main repository, do it like this:
596
597     git push git@github.openssl.org:openssl/openssl.git \\
598         $tmp_release_branch:$release_branch
599     git push git@github.openssl.org:openssl/openssl.git \\
600         $tag
601 EOF
602 fi
603
604 cat <<EOF
605
606 ----------------------------------------------------------------------
607 EOF
608
609 cat <<EOF
610
611 When everything is done, or if something went wrong and you want to start
612 over, simply clean away temporary things left behind:
613
614 The release worktree:
615
616     rm -rf $release_clone
617 EOF
618
619 if $do_branch; then
620     cat <<EOF
621
622 The additional release branches:
623
624     git branch -D $tmp_release_branch
625     git branch -D $tmp_update_branch
626 EOF
627 else
628     cat <<EOF
629
630 The temporary release branch:
631
632     git branch -D $tmp_release_branch
633 EOF
634 fi
635
636 exit 0
637
638 # cat is inconsequential, it's only there to fend off zealous shell parsers
639 # that parse all the way here.
640 cat <<EOF
641 ### BEGIN MANUAL
642 =pod
643
644 =head1 NAME
645
646 release.sh - OpenSSL release script
647
648 =head1 SYNOPSIS
649
650 B<release.sh>
651 [
652 B<--alpha> |
653 B<--next-beta> |
654 B<--beta> |
655 B<--final> |
656 B<--branch> |
657 B<--local-user>=I<keyid> |
658 B<--reviewer>=I<id> |
659 B<--no-upload> |
660 B<--no-update> |
661 B<--verbose> |
662 B<--debug> |
663 B<--help> |
664 B<--manual>
665 ]
666
667 =head1 DESCRIPTION
668
669 B<release.sh> creates an OpenSSL release, given current worktree conditions.
670 It will refuse to work unless the current branch is C<master> or a release
671 branch (see L</RELEASE BRANCHES AND TAGS> below for a discussion on those).
672
673 B<release.sh> tries to be smart and figure out the next release if no hints
674 are given through options, and will exit with an error in ambiguous cases.
675
676 B<release.sh> finishes off with instructions on what to do next.  When
677 finishing commands are given, they must be followed exactly.
678
679 B<release.sh> leaves behind a clone of the local workspace, as well as one
680 or two branches in the local repository.  These will be mentioned and can
681 safely be removed after all instructions have been successfully followed.
682
683 =head1 OPTIONS
684
685 =over 4
686
687 =item B<--alpha>, B<--beta>
688
689 Set the state of this branch to indicate that alpha or beta releases are
690 to be done.
691
692 B<--alpha> is only acceptable if the I<PATCH> version number is zero and
693 the current state is "in development" or that alpha releases are ongoing.
694
695 B<--beta> is only acceptable if the I<PATCH> version number is zero and
696 that alpha or beta releases are ongoing.
697
698 =item B<--next-beta>
699
700 Use together with B<--alpha> to switch to beta releases after the current
701 release is done.
702
703 =item B<--final>
704
705 Set the state of this branch to indicate that regular releases are to be
706 done.  This is only valid if alpha or beta releases are currently ongoing.
707
708 This implies B<--branch>.
709
710 =item B<--branch>
711
712 Create a branch specific for the I<SERIES> release series, if it doesn't
713 already exist, and switch to it.  The exact branch name will be
714 C<< openssl-I<SERIES> >>.
715
716 =item B<--no-upload>
717
718 Don't upload the produced files.
719
720 =item B<--no-update>
721
722 Don't run C<make update> and C<make update-fips-checksums>.
723
724 =item B<--verbose>
725
726 Verbose output.
727
728 =item B<--debug>
729
730 Display extra debug output.  Implies B<--no-upload>
731
732 =item B<--local-user>=I<keyid>
733
734 Use I<keyid> as the local user for C<git tag> and for signing with C<gpg>.
735
736 If not given, then the default e-mail address' key is used.
737
738 =item B<--reviewer>=I<id>
739
740 Add I<id> to the set of reviewers for the commits performed by this script.
741 Multiple reviewers are allowed.
742
743 If no reviewer is given, you will have to run C<addrev> manually, which
744 means retagging a release commit manually as well.
745
746 =item B<--force>
747
748 Force execution.  Precisely, the check that the current branch is C<master>
749 or a release branch is not done.
750
751 =item B<--help>
752
753 Display a quick help text and exit.
754
755 =item B<--manual>
756
757 Display this manual and exit.
758
759 =back
760
761 =head1 RELEASE BRANCHES AND TAGS
762
763 Prior to OpenSSL 3.0, the release branches were named
764 C<< OpenSSL_I<SERIES>-stable >>, and the release tags were named
765 C<< OpenSSL_I<VERSION> >> for regular releases, or
766 C<< OpenSSL_I<VERSION>-preI<n> >> for pre-releases.
767
768 From OpenSSL 3.0 ongoing, the release branches are named
769 C<< openssl-I<SERIES> >>, and the release tags are named
770 C<< openssl-I<VERSION> >> for regular releases, or
771 C<< openssl-I<VERSION>-alphaI<n> >> for alpha releases
772 and C<< openssl-I<VERSION>-betaI<n> >> for beta releases.
773
774 B<release.sh> recognises both forms.
775
776 =head1 VERSION AND STATE
777
778 With OpenSSL 3.0, all the version and state information is in the file
779 F<VERSION.dat>, where the following variables are used and changed:
780
781 =over 4
782
783 =item B<MAJOR>, B<MINOR>, B<PATCH>
784
785 The three part of the version number.
786
787 =item B<PRE_RELEASE_TAG>
788
789 The indicator of the current state of the branch.  The value may be one pf:
790
791 =over 4
792
793 =item C<dev>
794
795 This branch is "in development".  This is typical for the C<master> branch
796 unless there are ongoing alpha or beta releases.
797
798 =item C<< alphaI<n> >> or C<< alphaI<n>-dev >>
799
800 This branch has alpha releases going on.  C<< alphaI<n>-dev >> is what
801 should normally be seen in the git workspace, indicating that
802 C<< alphaI<n> >> is in development.  C<< alphaI<n> >> is what should be
803 found in the alpha release tar file.
804
805 =item C<< alphaI<n> >> or C<< alphaI<n>-dev >>
806
807 This branch has beta releases going on.  The details are otherwise exactly
808 as for alpha.
809
810 =item I<no value>
811
812 This is normally not seen in the git workspace, but should always be what's
813 found in the tar file of a regular release.
814
815 =back
816
817 =item B<BUILD_METADATA>
818
819 Extra build metadata to be used by anyone for their own purposes.
820
821 =item B<RELEASE_DATE>
822
823 This is normally empty in the git workspace, but should always have the
824 release date in the tar file of any release.
825
826 =back
827
828 =head1 COPYRIGHT
829
830 Copyright 2020-2022 The OpenSSL Project Authors. All Rights Reserved.
831
832 Licensed under the Apache License 2.0 (the "License").  You may not use
833 this file except in compliance with the License.  You can obtain a copy
834 in the file LICENSE in the source distribution or at
835 L<https://www.openssl.org/source/license.html>.
836
837 =cut
838 ### END MANUAL
839 EOF