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