Skip to content

Commit

Permalink
Merge pull request #8 from Deltares/feat/add-cz
Browse files Browse the repository at this point in the history
feat: Add automatic bump, changelog and release with commitizen.
  • Loading branch information
avgils authored Feb 17, 2022
2 parents 4c7e1e6 + be9e244 commit ed1cec6
Show file tree
Hide file tree
Showing 8 changed files with 85 additions and 55 deletions.
11 changes: 11 additions & 0 deletions .cz.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
[tool]
[tool.commitizen]
name = "cz_conventional_commits"
version = "0.1.1"
tag_format = "v$version"
version_files = [
"setup.py:^version",
"liwo_services/__init__.py:__version__",
]

annotated_tag = true
30 changes: 30 additions & 0 deletions .github/workflows/bump.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: Bump version

on:
push:
branches:
- master

jobs:
bump-version:
if: "!startsWith(github.event.head_commit.message, 'bump:')"
runs-on: ubuntu-latest
name: "Bump version and create release with commitizen changelog"
steps:
- name: Check out
uses: actions/checkout@v2
with:
token: "${{ secrets.GITHUB_TOKEN }}"
fetch-depth: 0
- name: Create bump and changelog
uses: commitizen-tools/commitizen-action@master
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
changelog_increment_filename: body.md
- name: Release
uses: softprops/action-gh-release@v1
with:
body_path: "body.md"
tag_name: ${{ env.REVISION }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
12 changes: 0 additions & 12 deletions .travis.yml

This file was deleted.

5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
## Unreleased

## v0.1.1 (2021-03-31)

## v0.1.0 (2021-02-23)
4 changes: 2 additions & 2 deletions liwo_services/__init__.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
"""Top-level package for LIWO Services."""

__author__ = """Fedor Baart"""
__email__ = '[email protected]'
__version__ = '0.1.0'
__email__ = "[email protected]"
__version__ = "0.1.1"
5 changes: 3 additions & 2 deletions requirements_dev.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
pip==19.2.3
bump2version==0.5.11
wheel==0.33.6
watchdog==0.9.0
flake8==3.7.8
Expand All @@ -9,4 +8,6 @@ Sphinx==1.8.5
twine==1.14.0
Click==7.0
pytest==4.6.5
pytest-runner==5.1
pytest-runner==5.1
commitizen-2.20.*
black==22.1.*
13 changes: 0 additions & 13 deletions setup.cfg
Original file line number Diff line number Diff line change
@@ -1,16 +1,3 @@
[bumpversion]
current_version = 0.1.0
commit = True
tag = True

[bumpversion:file:setup.py]
search = version='{current_version}'
replace = version='{new_version}'

[bumpversion:file:liwo_services/__init__.py]
search = __version__ = '{current_version}'
replace = __version__ = '{new_version}'

[bdist_wheel]
universal = 1

Expand Down
60 changes: 34 additions & 26 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,52 +2,60 @@

"""The setup script."""

from setuptools import setup, find_packages
from setuptools import find_packages, setup

with open('README.rst') as readme_file:
with open("README.rst") as readme_file:
readme = readme_file.read()

with open('HISTORY.rst') as history_file:
with open("HISTORY.rst") as history_file:
history = history_file.read()

requirements = ['Click>=7.0', ]
requirements = [
"Click>=7.0",
]

setup_requirements = ['pytest-runner', ]
setup_requirements = [
"pytest-runner",
]

test_requirements = ['pytest>=3', ]
test_requirements = [
"pytest>=3",
]

version = "v0.1.1"

setup(
author="Fedor Baart",
author_email='[email protected]',
python_requires='>=3.5',
author_email="[email protected]",
python_requires=">=3.5",
classifiers=[
'Development Status :: 2 - Pre-Alpha',
'Intended Audience :: Developers',
'License :: OSI Approved :: GNU General Public License v3 (GPLv3)',
'Natural Language :: English',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.5',
'Programming Language :: Python :: 3.6',
'Programming Language :: Python :: 3.7',
'Programming Language :: Python :: 3.8',
"Development Status :: 2 - Pre-Alpha",
"Intended Audience :: Developers",
"License :: OSI Approved :: GNU General Public License v3 (GPLv3)",
"Natural Language :: English",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.5",
"Programming Language :: Python :: 3.6",
"Programming Language :: Python :: 3.7",
"Programming Language :: Python :: 3.8",
],
description="LIWO Backend Services",
entry_points={
'console_scripts': [
'liwo_services=liwo_services.cli:cli',
"console_scripts": [
"liwo_services=liwo_services.cli:cli",
],
},
install_requires=requirements,
license="GNU General Public License v3",
long_description=readme + '\n\n' + history,
long_description=readme + "\n\n" + history,
include_package_data=True,
keywords='liwo_services',
name='liwo_services',
packages=find_packages(include=['liwo_services', 'liwo_services.*']),
keywords="liwo_services",
name="liwo_services",
packages=find_packages(include=["liwo_services", "liwo_services.*"]),
setup_requires=setup_requirements,
test_suite='tests',
test_suite="tests",
tests_require=test_requirements,
url='https://github.com/Deltares/liwo_services',
version='0.1.0',
url="https://github.com/Deltares/liwo_services",
version=version,
zip_safe=False,
)

0 comments on commit ed1cec6

Please sign in to comment.