-
Notifications
You must be signed in to change notification settings - Fork 65
/
bump.jl
31 lines (27 loc) · 1.11 KB
/
bump.jl
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
using Dates
oldver = ARGS[1]
newver = ARGS[2]
function bump(file, oldpat, newpat)
println("Bumping $file...")
@assert oldpat != newpat
oldtext = read(file, String)
newtext = replace(oldtext, oldpat => newpat)
@assert newtext != oldtext
write(file, newtext)
end
function bumpver(file, pattern, oldver, newver)
@assert oldver != newver
oldpat = replace(pattern, "{}" => oldver)
@assert oldpat != pattern
newpat = replace(pattern, "{}" => newver)
@assert newpat != pattern
bump(file, oldver, newver)
end
bumpver("Project.toml", "version = \"{}\"\n", oldver, newver)
bumpver("pyproject.toml", "version = \"{}\"\n", oldver, newver)
bumpver("pysrc/juliacall/__init__.py", "__version__ = '{}'\n", oldver, newver)
bumpver("pysrc/juliacall/juliapkg.json", "\"version\": \"={}\"", oldver, newver)
bumpver("pysrc/juliacall/juliapkg-dev.json", "\"version\": \"={}\"", oldver, newver)
bumpver("src/PythonCall.jl", "VERSION = v\"{}\"", oldver, newver)
bumpver("src/Core/Core.jl", "VERSION = v\"{}\"", oldver, newver)
bump("docs/src/releasenotes.md", "## Unreleased", "## $newver ($(today()))")