release.sh 22 KB

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