Skip to content

Commit

Permalink
Fix release script
Browse files Browse the repository at this point in the history
  • Loading branch information
Akuli committed Jul 31, 2022
1 parent 66e3bf7 commit 243fd2d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ Open a terminal and run these commands:
python3 -m pip install --user --upgrade pip wheel
python3 -m venv porcupine-venv
source porcupine-venv/bin/activate
python3 -m pip install https://github.com/Akuli/porcupine/archive/v0.99.2.zip
python3 -m pip install https://github.com/Akuli/porcupine/archive/v0.99.02.zip
porcu

If you want to leave Porcupine running and use the same terminal for something else,
Expand All @@ -74,7 +74,7 @@ Then run these commands:
python3 -m pip install --user --upgrade pip wheel
python3 -m venv porcupine-venv
source porcupine-venv/bin/activate
python3 -m pip install https://github.com/Akuli/porcupine/archive/v0.99.2.zip
python3 -m pip install https://github.com/Akuli/porcupine/archive/v0.99.02.zip
porcu

If you want to leave Porcupine running and use the same terminal for something else,
Expand Down
5 changes: 2 additions & 3 deletions scripts/release.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
from porcupine import version_info as old_info

TAG_FORMAT = "v%d.%02d.%02d"
OLD_TAG_FORMAT = "v%d.%d.%d" # TODO: delete after the first calver release


def replace_in_file(path, old, new):
Expand Down Expand Up @@ -39,11 +38,11 @@ def main():
assert changelog.split("\n\n\n")[1].startswith("## Unreleased")
assert changelog.count("Unreleased") == 1

print(f"Version changes: {OLD_TAG_FORMAT % old_info} ---> {TAG_FORMAT % new_info}")
print(f"Version changes: {TAG_FORMAT % old_info} ---> {TAG_FORMAT % new_info}")

replace_in_file(Path("CHANGELOG.md"), "Unreleased", TAG_FORMAT % new_info)
replace_in_file(Path("porcupine/__init__.py"), repr(old_info), repr(new_info))
replace_in_file(Path("README.md"), OLD_TAG_FORMAT % old_info, TAG_FORMAT % new_info)
replace_in_file(Path("README.md"), TAG_FORMAT % old_info, TAG_FORMAT % new_info)
subprocess.check_call(["git", "add", "porcupine/__init__.py", "README.md", "CHANGELOG.md"])
subprocess.check_call(["git", "commit", "-m", f"Version {TAG_FORMAT % new_info}"])
subprocess.check_call(["git", "tag", TAG_FORMAT % new_info])
Expand Down

0 comments on commit 243fd2d

Please sign in to comment.