]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - contrib/libcbor/release.sh
zfs: merge openzfs/zfs@c0cf6ed67
[FreeBSD/FreeBSD.git] / contrib / libcbor / release.sh
1 #!/usr/bin/env bash
2
3 # Guides my forgetful self through the release process.
4 # Usage release.sh VERSION
5
6 set -e
7
8 function prompt() {
9         echo "$1 Confirm with 'Yes'"
10         read check
11         if [ "$check" != "Yes" ]; then
12                 echo "Aborting..."
13                 exit 1
14         fi
15 }
16 # http://stackoverflow.com/questions/59895/getting-the-source-directory-of-a-bash-script-from-within
17 DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
18 OUTDIR=$(mktemp -d)
19 TAG_NAME="v$1"
20
21 cd $DIR
22 python3 misc/update_version.py "$1"
23
24 echo ">>>>> Checking changelog"
25 grep -A 5 -F "$1" CHANGELOG.md || true
26 prompt "Is the changelog correct and complete?"
27
28 echo ">>>>> Checking Doxyfile"
29 grep PROJECT_NUMBER Doxyfile
30 prompt "Is the Doxyfile version correct?"
31
32 echo ">>>>> Checking CMakeLists"
33 grep -A 2 'SET(CBOR_VERSION_MAJOR' CMakeLists.txt
34 prompt "Is the CMake version correct?"
35
36 echo ">>>>> Checking docs"
37 grep 'version =\|release =' doc/source/conf.py
38 prompt "Are the versions correct?"
39
40 set -x
41 pushd doc
42 make clean
43 popd
44 doxygen
45 cd doc
46 make html
47 cd build
48
49 cp -r html libcbor_docs_html
50 tar -zcf libcbor_docs.tar.gz libcbor_docs_html
51
52 cp -r doxygen/html libcbor_api_docs_html
53 tar -zcf libcbor_api_docs.tar.gz libcbor_api_docs_html
54
55 mv libcbor_docs.tar.gz libcbor_api_docs.tar.gz "$OUTDIR"
56
57 pushd "$OUTDIR"
58 cmake "$DIR" -DCMAKE_BUILD_TYPE=Release -DWITH_TESTS=ON
59 make
60 ctest
61 popd
62
63 prompt "Will proceed to tag the release with $TAG_NAME."
64 git tag "$TAG_NAME"
65 git push --tags
66
67 set +x
68
69 echo "Release ready in $OUTDIR"
70 echo "Add the release to GitHub at https://github.com/PJK/libcbor/releases/new *now*"
71 prompt "Have you added the release to https://github.com/PJK/libcbor/releases/tag/$TAG_NAME?"
72
73 echo "Update the Hombrew formula (https://github.com/Homebrew/homebrew-core/blob/master/Formula/libcbor.rb) *now*"
74 echo "HOWTO: https://github.com/Linuxbrew/brew/blob/master/docs/How-To-Open-a-Homebrew-Pull-Request.md"
75 prompt "Have you updated the formula?"