Skip to content

Commit

Permalink
update release scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
mgates3 committed Oct 28, 2020
1 parent e7c6484 commit 0e11f98
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 3 deletions.
2 changes: 1 addition & 1 deletion tools/make_release.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env python
#!/usr/bin/env python3

import release
release.make( 'slate', 'include/slate/slate.hh', 'src/version.cc' )
19 changes: 17 additions & 2 deletions tools/release.py
Original file line number Diff line number Diff line change
Expand Up @@ -128,9 +128,22 @@ def make( project, version_h, version_c ):
r'// Version \d\d\d\d.\d\d.\d\d\n(#define \w+_VERSION) \d+',
r'// Version %s\n\1 %s' % (tag, version), count=1 )

print( '\n>> Updating version in: GNUmakefile' )
file_sub( 'GNUmakefile',
r'VERSION:\d\d\d\d.\d\d.\d\d',
r'VERSION:%s' % (tag), count=1 )

print( '\n>> Updating version in: CMakeLists.txt' )
file_sub( 'CMakeLists.txt',
r'VERSION \d\d\d\d.\d\d.\d\d',
r'VERSION %s' % (tag), count=1 )

# Update copyright in all files.
files = myrun( 'git ls-tree -r master --name-only',
stdout=PIPE, text=True ).rstrip().split( '\n' )
files.remove( 'blaspp' )
files.remove( 'lapackpp' )
files.remove( 'testsweeper' )
print( '\n>> Updating copyright in:', end=' ' )
for file in files:
print( file, end=', ' )
Expand Down Expand Up @@ -165,8 +178,10 @@ def make( project, version_h, version_c ):
break
# end

# git archive doesn't recurse submodule; do it with rsync.
os.mkdir( dir )
subprocess.run( 'git archive ' + tag + ' | tar -x -C ' + dir, shell=True )
subprocess.run( 'git ls-files --recurse-submodule | '
+ 'rsync -av --files-from=- ./ ' + dir + '/', shell=True )
os.chdir( dir )

# Update hash ID in version_c.
Expand All @@ -178,7 +193,7 @@ def make( project, version_h, version_c ):

# Build Doxygen docs. Create dummy 'make.inc' to avoid 'make config'.
open( 'make.inc', mode='a' ).close()
myrun( 'make docs' )
myrun( 'make docs blas=openblas' )
os.unlink( 'make.inc' )

os.chdir( '..' )
Expand Down

0 comments on commit 0e11f98

Please sign in to comment.