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