Skip to content

Commit

Permalink
build(release): Add release scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
asyrjasalo committed Jul 29, 2024
1 parent e4bb279 commit 285a966
Show file tree
Hide file tree
Showing 3 changed files with 37 additions and 1 deletion.
9 changes: 9 additions & 0 deletions .cz.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
[tool.commitizen]
bump_message = "chore: Release $new_version"
tag_format = "$version"
version = "1.4.3"
version_files = [
"README.md",
"pyproject.toml:version",
"src/REST/version.py:__version__"
]
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# RESTinstance
# RESTinstance (1.4.3)

[Robot Framework](http://robotframework.org) library for RESTful JSON APIs

Expand Down
27 changes: 27 additions & 0 deletions release.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
#!/bin/sh

# RESTinstance (https://github.com/asyrjasalo/RESTinstance)
# Robot Framework library for RESTful JSON APIs.
#
# Copyright(C) 2018- Anssi Syrjäsalo (http://a.syrjasalo.com)
# Licensed under GNU Lesser General Public License v3 (LGPL-3.0).

prerelease_type="$1"

branch="$(git branch --show-current)"
if [ "$branch" != "main" ] && [ "$branch" != "master" ]; then
echo "Error: Releases must be created from trunk, run $0 in main/master."
exit 1
fi

if [ -n "$(git status -s)" ]; then
echo "Error: Working tree has changes: Stash, commit or reset first"
exit 1
fi

if [ -n "$prerelease_type" ]; then
echo "Creating pre-release ($prerelease_type)"
pipx run --spec commitizen cz bump --prerelease "$prerelease_type"
else
pipx run --spec commitizen cz bump
fi

0 comments on commit 285a966

Please sign in to comment.