Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
freebsd
GitHub Repository: freebsd/freebsd-src
Path: blob/main/contrib/libcbor/release.sh
39478 views
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 10 -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 Bazel build"
37
grep -A 2 'CBOR_MAJOR_VERSION' examples/bazel/third_party/libcbor/cbor/configuration.h
38
prompt "Is the version correct?"
39
40
echo ">>>>> Checking docs"
41
grep 'version =\|release =' doc/source/conf.py
42
prompt "Are the versions correct?"
43
44
set -x
45
pushd doc
46
make clean
47
popd
48
doxygen
49
cd doc
50
make html
51
cd build
52
53
cp -r html libcbor_docs_html
54
tar -zcf libcbor_docs.tar.gz libcbor_docs_html
55
56
cp -r doxygen/html libcbor_api_docs_html
57
tar -zcf libcbor_api_docs.tar.gz libcbor_api_docs_html
58
59
mv libcbor_docs.tar.gz libcbor_api_docs.tar.gz "$OUTDIR"
60
61
pushd "$OUTDIR"
62
cmake "$DIR" -DCMAKE_BUILD_TYPE=Release -DWITH_TESTS=ON
63
make
64
ctest
65
popd
66
67
prompt "Will proceed to tag the release with $TAG_NAME."
68
git commit -a -m "Release $TAG_NAME"
69
git tag "$TAG_NAME"
70
git push --set-upstream origin $(git rev-parse --abbrev-ref HEAD)
71
git push --tags
72
73
set +x
74
75
echo "Release ready in $OUTDIR"
76
echo "Add the release to GitHub at https://github.com/PJK/libcbor/releases/new *now*"
77
prompt "Have you added the release to https://github.com/PJK/libcbor/releases/tag/$TAG_NAME?"
78
79
echo "Update the Hombrew formula (https://github.com/Homebrew/homebrew-core/blob/master/Formula/libcbor.rb) *now*"
80
echo "HOWTO: https://github.com/Linuxbrew/brew/blob/master/docs/How-To-Open-a-Homebrew-Pull-Request.md"
81
prompt "Have you updated the formula?"
82
83