bump version in toml's and changelog, and trigger deltachat-specific "cargo update". example: python set_core_version.py 1.0.0-beta.6 automates bumping the version and performs some quick sanity checks

This commit is contained in:
holger krekel
2019-10-30 20:05:01 +01:00
parent c56c10bced
commit b01c842d7c
5 changed files with 71 additions and 10 deletions

View File

@@ -1,10 +1,10 @@
# Changelog
## 1.0.0-beta5
## 1.0.0-beta.5
- fix dc_get_msg() to return empty messages when asked for special ones
## 1.0.0-beta4
## 1.0.0-beta.4
- fix more than one sending of autocrypt setup message
@@ -12,7 +12,7 @@
- tune down error to warning when adding self to chat
## 1.0.0-beta3
## 1.0.0-beta.3
- add back `dc_empty_server()` #682
@@ -26,7 +26,7 @@
- code streamlining and rustifications
## 1.0.0-beta2
## 1.0.0-beta.2
- https://c.delta.chat docs are now regenerated again through our CI
@@ -46,7 +46,7 @@
- some rustifications/boolifications of c-ints
## 1.0.0-beta1
## 1.0.0-beta.1
- first beta of the Delta Chat Rust core library. many fixes of crashes
and other issues compared to 1.0.0-alpha.5.

6
Cargo.lock generated
View File

@@ -480,7 +480,7 @@ dependencies = [
[[package]]
name = "deltachat"
version = "1.0.0-beta.4"
version = "1.0.0-beta.5"
dependencies = [
"backtrace 0.3.40 (registry+https://github.com/rust-lang/crates.io-index)",
"base64 0.10.1 (registry+https://github.com/rust-lang/crates.io-index)",
@@ -550,9 +550,9 @@ dependencies = [
[[package]]
name = "deltachat_ffi"
version = "1.0.0-beta.4"
version = "1.0.0-beta.5"
dependencies = [
"deltachat 1.0.0-beta.4",
"deltachat 1.0.0-beta.5",
"deltachat-provider-database 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)",
"human-panic 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)",
"libc 0.2.65 (registry+https://github.com/rust-lang/crates.io-index)",

View File

@@ -1,6 +1,6 @@
[package]
name = "deltachat"
version = "1.0.0-beta.4"
version = "1.0.0-beta.5"
authors = ["Delta Chat Developers (ML) <delta@codespeak.net>"]
edition = "2018"
license = "MPL"

View File

@@ -1,6 +1,6 @@
[package]
name = "deltachat_ffi"
version = "1.0.0-beta.4"
version = "1.0.0-beta.5"
description = "Deltachat FFI"
authors = ["Delta Chat Developers (ML) <delta@codespeak.net>"]
edition = "2018"

61
set_core_version.py Normal file
View File

@@ -0,0 +1,61 @@
#!/usr/bin/env python
import os
import sys
import re
import pathlib
import subprocess
rex = re.compile(r'version = "(\S+)"')
def read_toml_version(relpath):
p = pathlib.Path(relpath)
assert p.exists()
for line in open(str(p)):
m = rex.match(line)
if m is not None:
return m.group(1)
raise ValueError("no version found in {}".format(relpath))
def replace_toml_version(relpath, newversion):
p = pathlib.Path(relpath)
assert p.exists()
tmp_path = str(p) + "_tmp"
with open(tmp_path, "w") as f:
for line in open(str(p)):
m = rex.match(line)
if m is not None:
f.write('version = "{}"\n'.format(newversion))
else:
f.write(line)
os.rename(tmp_path, str(p))
if __name__ == "__main__":
if len(sys.argv) < 2:
raise SystemExit("need argument: new version, example 1.0.0-beta.27")
newversion = sys.argv[1]
if newversion.count(".") < 2:
raise SystemExit("need at least two dots in version")
core_toml = read_toml_version("Cargo.toml")
ffi_toml = read_toml_version("deltachat-ffi/Cargo.toml")
assert core_toml == ffi_toml, (core_toml, ffi_toml)
for line in open("CHANGELOG.md"):
## 1.0.0-beta5
if line.startswith("## "):
if line[2:].strip().startswith(newversion):
break
else:
raise SystemExit("CHANGELOG.md contains no entry for version: {}".format(newversion))
replace_toml_version("Cargo.toml", newversion)
replace_toml_version("deltachat-ffi/Cargo.toml", newversion)
subprocess.call(["cargo", "update", "-p", "deltachat"])
print("after commit make sure to: ")
print("")
print(" git tag {}".format(newversion))
print("")