|
1 | 1 | #!/bin/bash |
2 | 2 | # |
3 | | -# A script for creating release packages. The release packages are create in the home directory. |
| 3 | +# A script for creating release packages. The release packages are created in the home directory. |
4 | 4 | # |
5 | 5 | # Create release candidate |
6 | 6 | # ======================== |
7 | 7 | # |
8 | 8 | # Review trac roadmap, are tickets closed properly? |
9 | 9 | # Only tickets that should be retargeted should be open. |
10 | 10 | # |
11 | | -# update cppcheck used in premium addon CI |
12 | | -# create jira issue "CI: update cppcheck binary" |
13 | | -# cd ~/cppchecksolutions/addon/tools && python3 ci-update-cppcheck.py |
| 11 | +# Versioning scheme |
| 12 | +# ======================== |
| 13 | +# VERSION=2.22.0 # the new release tag created |
| 14 | +# PREV=2.21.0 # the previous release |
| 15 | +# BRANCH=2.22.x # release branch |
| 16 | +# |
| 17 | +# 2.22.x BRANCH - release branch |
| 18 | +# 2.22.0 TAG - the release |
| 19 | +# 2.22.1, ... TAG - patch releases |
| 20 | +# 2.22.0-rc1 TAG - release candidate |
14 | 21 | # |
15 | | -# update mappings.. |
| 22 | +# Update mappings: |
16 | 23 | # cd ~/cppchecksolutions/addon/coverage |
17 | 24 | # CPPCHECK_REPO=~/cppchecksolutions/cppcheck python3 coverage.py --code |
18 | 25 | # |
19 | | -# check every isPremiumEnabled call: TODO write helper script |
| 26 | +# Check every isPremiumEnabled call: TODO write helper script |
20 | 27 | # - every id should be in --errorlist |
21 | 28 | # git grep 'isPremiumEnabled[(]"' | sed 's/.*isPremiumEnabled[(]"//' | sed 's/".*//' | sort | uniq > ids1.txt |
22 | 29 | # ./cppcheck --errorlist | grep ' id="' | sed 's/.* id="//' | sed 's/".*//' | sort | uniq > ids2.txt |
|
29 | 36 | # - ensure latest build was successful |
30 | 37 | # - ensure cfg files etc are included (win_installer/cppcheck.wxs) |
31 | 38 | # |
32 | | -# self check, fix critical issues: |
| 39 | +# Self check, fix critical issues: |
33 | 40 | # make clean && make CXXOPTS=-O2 MATCHCOMPILER=yes -j4 |
34 | 41 | # ./cppcheck -D__CPPCHECK__ -D__GNUC__ -DCHECK_INTERNAL -DHAVE_RULES --std=c++11 --library=cppcheck-lib --library=qt --enable=style --inconclusive --inline-suppr --suppress=bitwiseOnBoolean --suppress=shadowFunction --suppress=useStlAlgorithm --suppress=*:externals/picojson.h --suppress=functionConst --suppress=functionStatic --suppress=normalCheckLevelMaxBranches --xml cli gui/*.cpp lib 2> selfcheck.xml |
35 | 42 | # |
36 | | -# Generate lib/checkers.cpp (TODO the premium checkers should not be statically coded) |
| 43 | +# Generate lib/checkers.cpp: (TODO the premium checkers should not be statically coded) |
37 | 44 | # cd ~/cppchecksolutions/cppcheck && python3 tools/get_checkers.py > lib/checkers.cpp |
38 | 45 | # |
39 | | -# Update copyright year TODO release script |
40 | | -# git diff 2.8 -- */*.cpp */*.h | grep '^diff --git a/' | sed 's|.* b/||' | xargs sed -i 's/Copyright (C) 2007-20[12]./Copyright (C) 2007-2022/' |
| 46 | +# Update copyright year: TODO release script |
| 47 | +# git diff $PREV -- */*.cpp */*.h | grep '^diff --git a/' | sed 's|.* b/||' | xargs sed -i "s/Copyright (C) 2007-20[12]./Copyright (C) 2007-$(date +%Y)/" |
41 | 48 | # git diff | grep '^diff --git a/' |
42 | 49 | # |
43 | 50 | # Make sure "cppcheck --errorlist" works: |
44 | 51 | # make clean && make -j4 && ./cppcheck --errorlist > errlist.xml && xmllint --noout errlist.xml |
45 | 52 | # |
46 | 53 | # Update AUTHORS using output from: |
47 | | -# git log --format='%aN' 2.7..HEAD | sort -u > AUTHORS2 && diff -y AUTHORS AUTHORS2 | less |
| 54 | +# git log --format='%aN' $PREV..HEAD | sort -u > AUTHORS2 && diff -y AUTHORS AUTHORS2 | less |
| 55 | +# Include github usernames in PR title and commit message |
48 | 56 | # |
49 | | -# Update GUI translations |
50 | | -# lupdate gui.pro |
| 57 | +# Update GUI translations: |
| 58 | +# cd ~/cppchecksolutions/cppcheck/gui && lupdate gui.pro |
51 | 59 | # |
52 | | -# Create 2.18.x branch |
53 | | -# git checkout -b 2.18.x ; git push -u origin 2.18.x |
| 60 | +# Create new release branch: |
| 61 | +# git checkout -b $BRANCH && git push -u origin $BRANCH |
54 | 62 | # in fork: |
55 | | -# * add upstream: git remote add upstream git@github.com:/cppcheck-opensource//cppcheck.git |
56 | | -# * add branch: git fetch upstream 2.19.x |
| 63 | +# * add upstream: git remote add upstream git@github.com:cppcheck-opensource/cppcheck.git |
| 64 | +# * add branch: git fetch upstream $BRANCH |
57 | 65 | # |
58 | 66 | # Release notes: |
59 | 67 | # - ensure safety critical issues are listed properly |
60 | 68 | # - empty the releasenotes.txt in main branch |
61 | 69 | # |
62 | 70 | # Update version numbers in: |
63 | | -# python3 tools/release-set-version.py 2.19.0 |
| 71 | +# python3 tools/release-set-version.py $VERSION |
64 | 72 | # Verify: |
65 | 73 | # grep '\.99' */*.[ch]* && grep '[0-9][0-9] dev' */*.[ch]* |
66 | 74 | # egrep "2\.[0-9]+" */*.h */*.cpp man/*.md | grep -v "test/test" | less |
67 | | -# git commit -a -m "2.8: Set versions" |
| 75 | +# git commit -a -m "$VERSION: Set versions" |
68 | 76 | # |
69 | 77 | # Build and test the windows installer |
70 | 78 | # |
71 | 79 | # Update the Makefile: |
72 | 80 | # make dmake && ./dmake --release |
73 | | -# git commit -a -m "2.8: Updated Makefile" |
| 81 | +# git commit -a -m "$VERSION: Updated Makefile" |
| 82 | +# |
| 83 | +# Push changes: |
| 84 | +# git push |
74 | 85 | # |
75 | 86 | # Ensure that CI is happy |
76 | 87 | # |
77 | 88 | # Tag: |
78 | | -# git tag 2.8-rc1 |
| 89 | +# git tag $VERSION-rc1 |
79 | 90 | # git push --tags |
80 | 91 | # |
81 | 92 | # Release |
82 | | -# ======= |
| 93 | +# ======================== |
83 | 94 | # |
84 | 95 | # Remove "-rc1" from versions. Test: git grep "\-rc[0-9]" |
85 | 96 | # |
86 | 97 | # Create a release folder on sourceforge: |
87 | 98 | # https://sourceforge.net/projects/cppcheck/files/cppcheck/ |
88 | 99 | # |
89 | | -# git tag 2.8 ; git push --tags |
90 | | -# ./createrelease 2.8 |
| 100 | +# git tag $VERSION && git push --tags |
| 101 | +# ./createrelease $VERSION |
91 | 102 | # |
92 | | -# copy msi from release-windows, install and test cppcheck |
93 | | -# copy manual from build-manual |
| 103 | +# Copy msi from release-windows, install and test cppcheck |
| 104 | +# Copy manual from build-manual |
94 | 105 | # |
95 | 106 | # Update download link on index.php main page |
96 | 107 | # |
97 | 108 | # Trac: |
98 | | -# 1. Create ticket "2.18 safety cosmetic changes" |
99 | | -# git log --format=oneline 2.17.0..HEAD | egrep -v "^[0-9a-f]*[ ][ ]*([Ff]ix|fixed|Fixup|Fixes|refs)?[ ]*#*[0-9]+" |
| 109 | +# 1. Create ticket "$VERSION safety cosmetic changes" |
| 110 | +# git log --format=oneline $PREV..HEAD | egrep -v "^[0-9a-f]*[ ][ ]*([Ff]ix|fixed|Fixup|Fixes|refs)?[ ]*#*[0-9]+" |
100 | 111 | # 2. Check priorities for all tickets in milestone. Should be: safety-* |
101 | 112 | # 3. Create new milestone |
102 | 113 | # 4. Close old milestone |
103 | 114 | # |
104 | | -# write a news |
| 115 | +# Write a news |
105 | 116 | # |
106 | | -# save "cppcheck --doc" output on wiki |
| 117 | +# Save "cppcheck --doc" output on wiki |
107 | 118 | # |
108 | | -# compile new democlient: |
| 119 | +# Compile new democlient: |
109 | 120 | # ssh -t danielmarjamaki,cppcheck@shell.sourceforge.net create |
110 | 121 | # ./build-cppcheck.sh |
111 | 122 | # |
112 | | -# create a ticket with data from http://cppcheck1.osuosl.org:8000/time_gt.html for performance tracking |
| 123 | +# Create a ticket with data from http://cppcheck1.osuosl.org:8000/time_gt.html for performance tracking |
113 | 124 | # (example: https://trac.cppcheck.net/ticket/13715) |
114 | 125 | # - type: defect |
115 | 126 | # - component: Performance |
116 | | -# - summary: [meta] performance regressions in 2.x |
| 127 | +# - summary: [meta] performance regressions in $VERSION |
117 | 128 | # |
118 | | -# run daca with new release |
| 129 | +# Run daca with new release: |
119 | 130 | # 1. edit tools/donate-cpu-server.py. Update OLD_VERSION and SERVER_VERSION |
120 | 131 | # 2. scp -i ~/.ssh/osuosl_id_rsa tools/donate-cpu-server.py danielmarjamaki@cppcheck1.osuosl.org:/var/daca@home/ |
121 | 132 | # |
122 | 133 | # Backup: |
123 | 134 | # * trac: cd /var && nice tar -cJf ~/trac.tar.xz trac-cppcheck/db/trac.db |
124 | 135 | # * daca: cd /var && nice tar -cJf ~/daca.tar.xz daca@home |
125 | 136 | # * git: git checkout -f && git checkout main && git pull && tar -cJf git.tar.xz .git |
126 | | -# * git log 2.16.0..2.17.0 > Changelog |
127 | | -# * mkdir out && python3 ~/cppchecksolutions/release/getWorkflowAndIssueLogs.py -r /cppcheck-opensource//cppcheck -t 2.15.0 -p out |
| 137 | +# * git log $PREV..$VERSION > Changelog |
| 138 | +# * mkdir out && python3 ~/cppchecksolutions/release/getWorkflowAndIssueLogs.py -r /cppcheck-opensource//cppcheck -t $VERSION -p out |
128 | 139 |
|
129 | | -# Folder/tag to use |
130 | | -folder=$1 |
131 | | -tag=$folder.0 |
| 140 | +# Folder/tag to use: |
| 141 | +tag=$1 |
| 142 | +folder=${tag%.*} |
132 | 143 |
|
133 | | -# Name of release |
| 144 | +# Name of release: |
134 | 145 | releasename=cppcheck-$tag |
135 | 146 |
|
136 | 147 | set -e |
@@ -162,7 +173,7 @@ scp htdocs/* danielmarjamaki,cppcheck@web.sourceforge.net:htdocs/ |
162 | 173 | cd .. |
163 | 174 | rm -rf upload |
164 | 175 |
|
165 | | -# Local cppcheck binary |
| 176 | +# Local cppcheck binary: |
166 | 177 | mkdir -p ~/.cppcheck/$tag |
167 | 178 | cd ~/.cppcheck/$tag |
168 | 179 | cp -R ~/cppcheck/cfg . |
|
0 commit comments