1414def main ():
1515 versionH = open ('version.h.in' , 'r' ).read ()
1616
17- oldClangStable = '17 '
18- newClangStable = '18 '
19- newInsightsVersion = '18 .0'
17+ oldClangStable = '18 '
18+ newClangStable = '19 '
19+ newInsightsVersion = f' { newClangStable } .0'
2020 oldInsightsVersion = re .search (r'INSIGHTS_VERSION\s+"(.*?)"' , versionH , re .DOTALL | re .MULTILINE ).group (1 )
2121
2222
@@ -40,7 +40,6 @@ def main():
4040 travis = re .sub (r"(llvm-toolchain-xenial)-(%s)" % (oldClangStable ), r"\1-%s" % (newClangStable ) , travis )
4141 travis = re .sub (r"(./llvm.sh) (%s)" % (oldClangStable ), r"\1 %s" % (newClangStable ) , travis )
4242
43- # print(travis)
4443 open ('.github/workflows/ci.yml' , 'w' ).write (travis )
4544
4645
@@ -50,32 +49,23 @@ def main():
5049 open ('CMakeLists.txt' , 'w' ).write (cmake )
5150
5251
53- print (' - Updating version.h %s -> %s' % ( oldInsightsVersion , newInsightsVersion ) )
52+ print (f ' - Updating version.h { oldInsightsVersion } -> { newInsightsVersion } ' )
5453 version = open ('version.h.in' , 'r' ).read ()
5554 version = re .sub ('(INSIGHTS_VERSION )"(.*)"' , '\\ 1"%s"' % (newInsightsVersion ) , version )
5655 open ('version.h.in' , 'w' ).write (version )
5756
57+ cppInsightsDockerBaseFile = '../cppinsights-docker-base/Dockerfile'
5858
59- print (' - Generating CHANGELOG.md' )
60- os .system ('gren changelog --override --username=andreasfertig --repo=cppinsights %s...continous' % (oldInsightsVersion ))
61-
62- cmd = ['gren' , 'changelog' , '--override' , '--username=andreasfertig' , '--repo=cppinsights' , '%s...continous' % (oldInsightsVersion )]
63- p = subprocess .Popen (cmd , stdout = subprocess .PIPE , stderr = subprocess .PIPE )
64- stdout , stderr = p .communicate ()
59+ print (f' - Updating cppinsights-docker-base ({ cppInsightsDockerBaseFile } )' )
6560
66- if 0 != p .returncode :
67- print ('ERR: gren failed' )
68- print (stderr )
69- return 1
61+ dockerFile = open (cppInsightsDockerBaseFile , 'r' ).read ()
62+ dockerFile = re .sub (r'(ENV\s+CLANG_VERSION=)([0-9]+)' , r'\g<1>%s' % (newClangStable ), dockerFile )
63+ open (cppInsightsDockerBaseFile , 'w' ).write (dockerFile )
7064
71- changeLog = open ('CHANGELOG.md' , 'r' ).read ()
72- changeLog = re .sub ('(## Continuous build.*?---)\n ' , '' , changeLog , flags = re .DOTALL )
73- open ('CHANGELOG.md' , 'w' ).write (changeLog )
7465
75- gitTag = 'v_%s' % ( oldInsightsVersion )
76- print (' - Tagging %s' % ( gitTag ) )
66+ gitTag = f 'v_{ oldInsightsVersion } '
67+ print (f ' - Tagging { gitTag } ' )
7768
78- #cmd = ['git', 'tag', '-a', '-m', gitTag, gitTag, 'main']
7969 cmd = ['git' , 'tag' , gitTag , 'main' ]
8070 p = subprocess .Popen (cmd , stdout = subprocess .PIPE , stderr = subprocess .PIPE )
8171 stdout , stderr = p .communicate ()
@@ -85,13 +75,8 @@ def main():
8575 print (stderr )
8676 return 1
8777
88- cppInsightsDockerBaseFile = '../cppinsights-docker-base/Dockerfile'
89-
90- print (' - Updating cppinsights-docker-base (%s)' % (cppInsightsDockerBaseFile ))
91-
92- dockerFile = open (cppInsightsDockerBaseFile , 'r' ).read ()
93- dockerFile = re .sub (r'(ENV\s+CLANG_VERSION=)([0-9]+)' , r'\g<1>%s' % (newClangStable ), dockerFile )
94- open (cppInsightsDockerBaseFile , 'w' ).write (dockerFile )
78+ print (' - Push tag:' )
79+ print (f' git push origin { gitTag } ' )
9580#------------------------------------------------------------------------------
9681
9782main ()
0 commit comments