Skip to content

Commit

Permalink
version bump
Browse files Browse the repository at this point in the history
  • Loading branch information
lemire committed Nov 22, 2023
1 parent 697963d commit bc1bb64
Show file tree
Hide file tree
Showing 5 changed files with 32 additions and 25 deletions.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 3.15)
project(simdutf
DESCRIPTION "Fast Unicode validation, transcoding and processing"
LANGUAGES CXX
VERSION 4.0.4
VERSION 4.0.5
)

include (TestBigEndian)
Expand Down
2 changes: 1 addition & 1 deletion Doxyfile
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ PROJECT_NAME = simdutf
# could be handy for archiving the generated documentation or if some version
# control system is used.

PROJECT_NUMBER = "4.0.4"
PROJECT_NUMBER = "4.0.5"

# Using the PROJECT_BRIEF tag one can provide an optional one line description
# for a project that appears at the top of each page and should give viewer a
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ Linux or macOS users might follow the following instructions if they have a rece

1. Pull the library in a directory
```
wget https://github.com/simdutf/simdutf/releases/download/v4.0.4/singleheader.zip
wget https://github.com/simdutf/simdutf/releases/download/v4.0.5/singleheader.zip
unzip singleheader.zip
```
2. Compile
Expand Down Expand Up @@ -192,7 +192,7 @@ Single-header version
You can create a single-header version of the library where
all of the code is put into two files (`simdutf.h` and `simdutf.cpp`).
We publish a zip archive containing these files, e.g., see
https://github.com/simdutf/simdutf/releases/download/v4.0.4/singleheader.zip
https://github.com/simdutf/simdutf/releases/download/v4.0.5/singleheader.zip

You may generate it on your own using a Python script.

Expand Down
4 changes: 2 additions & 2 deletions include/simdutf/simdutf_version.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
#define SIMDUTF_SIMDUTF_VERSION_H

/** The version of simdutf being used (major.minor.revision) */
#define SIMDUTF_VERSION "4.0.4"
#define SIMDUTF_VERSION "4.0.5"

namespace simdutf {
enum {
Expand All @@ -19,7 +19,7 @@ enum {
/**
* The revision (major.minor.REVISION) of simdutf being used.
*/
SIMDUTF_VERSION_REVISION = 4
SIMDUTF_VERSION_REVISION = 5
};
} // namespace simdutf

Expand Down
45 changes: 26 additions & 19 deletions scripts/release.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ def toversionstring(major, minor, rev):

def topaddedversionstring(major, minor, rev):
return str(major)+str(minor).zfill(3)+str(rev).zfill(3)

print("Calling git rev-parse --abbrev-ref HEAD")
pipe = subprocess.Popen(["git", "rev-parse", "--abbrev-ref", "HEAD"], stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
branchresult = pipe.communicate()[0].decode().strip()

Expand All @@ -34,7 +34,7 @@ def topaddedversionstring(major, minor, rev):

if(ret != 0):
sys.exit(ret)

print("Calling git log HEAD.. --oneline")
pipe = subprocess.Popen(["git", "log", "HEAD..", "--oneline"], stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
uptodateresult = pipe.communicate()[0].decode().strip()

Expand Down Expand Up @@ -62,12 +62,12 @@ def topaddedversionstring(major, minor, rev):
sys.exit(-1)
try:
newversion = extractnumbers(sys.argv[1])
print(newversion)
except:
print("can't parse version number "+sys.argv[1])
sys.exit(-1)

print("checking that new version is valid")

if(newversion[0] != currentv[0]):
assert newversion[0] == currentv[0] + 1
assert newversion[1] == 0
Expand All @@ -80,15 +80,6 @@ def topaddedversionstring(major, minor, rev):

atleastminor= (currentv[0] != newversion[0]) or (currentv[1] != newversion[1])

if(atleastminor):
print(colored(0, 255, 0, "This is more than a revision."))
releasefile = maindir + os.sep + "RELEASES.md"
releasedata = open(releasefile).read()
pattern = re.compile("#\s+\d+\.\d+")
m = pattern.search(releasedata)
if(m == None):
print(colored(255, 0, 0, "You are preparing a new minor release and you have not yet updated RELEASES.md."))
sys.exit(-1)

versionfilerel = os.sep + "include" + os.sep + "simdutf" + os.sep + "simdutf_version.h"
versionfile = maindir + versionfilerel
Expand Down Expand Up @@ -128,7 +119,6 @@ def topaddedversionstring(major, minor, rev):
newrevversionstring = str(newversion[2])
newversionstring = str(newversion[0]) + "." + str(newversion[1]) + "." + str(newversion[2])
cmakefile = maindir + os.sep + "CMakeLists.txt"

sonumber = None
pattern = re.compile("set\(SIMDUTF_LIB_SOVERSION \"(\d+)\" CACHE STRING \"simdutf library soversion\"\)")
with open (cmakefile, 'rt') as myfile:
Expand All @@ -144,8 +134,8 @@ def topaddedversionstring(major, minor, rev):
sonumber += 1

for line in fileinput.input(cmakefile, inplace=1, backup='.bak'):
line = re.sub(' VERSION \d+\.\d+\.\d+',' VERSION '+newmajorversionstring+'.'+mewminorversionstring+'.'+newrevversionstring, line.rstrip())
line = re.sub('SIMDUTF_LIB_VERSION "\d+\.\d+\.\d+','SIMDUTF_LIB_VERSION "'+newversionstring, line)
line = re.sub(' VERSION \d+\.\d+\.\d+',' VERSION '+newmajorversionstring+'.'+mewminorversionstring+'.'+newrevversionstring, line.rstrip())
line = re.sub('SIMDUTF_LIB_VERSION "\d+\.\d+\.\d+','SIMDUTF_LIB_VERSION "'+str(sonumber)+".0.0", line)
line = re.sub('set\(SIMDUTF_LIB_SOVERSION \"\d+\"','set(SIMDUTF_LIB_SOVERSION \"'+str(sonumber)+'\"', line)
print(line)

Expand All @@ -159,24 +149,41 @@ def topaddedversionstring(major, minor, rev):
print("modified "+doxyfile+", a backup was made")


print("running amalgamate.py")
cp = subprocess.run(["python3", maindir+ os.sep + "singleheader/amalgamate.py"], stdout=subprocess.DEVNULL) # doesn't capture output

cp = subprocess.run([sys.executable, "amalgamate.py"], stdout=subprocess.DEVNULL, cwd=maindir+ os.sep + "singleheader") # doesn't capture output
if(cp.returncode != 0):
print("Failed to run amalgamate")
else:
print("The singleheader/singleheader.zip file has been updated.")

print("running doxygen")
cp = subprocess.run(["doxygen"], stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL, cwd=maindir) # doesn't capture output

if(cp.returncode != 0):
print("Failed to run doxygen")


readmefile = maindir + os.sep + "README.md"


for line in fileinput.input(readmefile, inplace=1, backup='.bak'):
line = re.sub('\s*https://github.com/simdutf/simdutf/releases/download/v(\d+\.\d+\.\d+)/singleheader.zip\s*','https://github.com/simdutf/simdutf/releases/download/v'+newversionstring+'/singleheader.zip', line.rstrip())
line = re.sub(' wget https://github.com/simdutf/simdutf/releases/download/v\d+\.\d+\.\d+/singleheader.zip',' wget https://github.com/simdutf/simdutf/releases/download/v'+newmajorversionstring+'.'+mewminorversionstring+'.'+newrevversionstring+'/singleheader.zip', line.rstrip())
line = re.sub('https://github.com/simdutf/simdutf/releases/download/v\d+\.\d+\.\d+/singleheader.zip','https://github.com/simdutf/simdutf/releases/download/v'+newmajorversionstring+'.'+mewminorversionstring+'.'+newrevversionstring+'/singleheader.zip', line.rstrip())
print(line)

print("modified "+readmefile+", a backup was made")

pattern = re.compile("https://simdutf.org/api/(\d+\.\d+\.\d+)/index.html")
readmedata = open(readmefile).read()
m = pattern.search(readmedata)
if m == None:
print('I cannot find a link to the API documentation in your README')
else:
detectedreadme = m.group(1)
print("found a link to your API documentation in the README file: "+detectedreadme+" ("+toversionstring(*newversion)+")")
if(atleastminor):
if(detectedreadme != toversionstring(*newversion)):
print(colored(255, 0, 0, "Consider updating the readme link to "+toversionstring(*newversion)))



print("Please run the tests before issuing a release. \n")
Expand Down

0 comments on commit bc1bb64

Please sign in to comment.