Skip to content

Commit

Permalink
feat: Add automatically versioning to the release process
Browse files Browse the repository at this point in the history
  • Loading branch information
mazulo committed Nov 15, 2022
1 parent f295cf9 commit 8bba500
Show file tree
Hide file tree
Showing 5 changed files with 49 additions and 5 deletions.
12 changes: 8 additions & 4 deletions .github/workflows/publish-to-test-pypi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,16 @@ jobs:

- name: Install dependencies
run: |
python -m pip install --upgrade pip setuptools wheel twine
pip install --upgrade pip setuptools wheel twine
pip install -r requirements.txt
pip install -e .
- name: Build a binary wheel and a source tarball
run: python setup.py sdist bdist_wheel
- name: Use Python Semantic Release to prepare release
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
git config user.name github-actions
git config user.email [email protected]
semantic-release publish
- name: Publish distribution 📦 to Test PyPI
uses: pypa/gh-action-pypi-publish@release/v1
Expand Down
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<!--next-version-placeholder-->
37 changes: 37 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
[tool.poetry]
name = "pynews"
version = "0.2.2"
description = "PyNews is a simple Python CLI to browse news from HN website"
license = {text = "GNU General Public License v3 (GPLv3)"}
readme = "README.rst"
classifiers = [
"Intended Audience :: Developers",
"Development Status :: 5 - Production/Stable",
"Environment :: Console",
"License :: OSI Approved :: GNU General Public License v3 (GPLv3)",
"Operating System :: OS Independent",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.7",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Topic :: Utilities",
"Topic :: System :: Shells",
]

[build-system]
requires = ["setuptools>=61.0"]
build-backend = "setuptools.build_meta"

[tool.semantic_release]
version_variable = [
"setup.py:__version__",
"pyproject.toml:version",
]
branch = "main"
changelog_file = "CHANGELOG.md"
dist_path = "dist/"
upload_to_release = true
upload_to_pypi = false
remove_dist = false
patch_without_tag = true
1 change: 1 addition & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
curses-menu==0.6.7
requests==2.28.1
alive-progress==2.4.1
python-semantic-release==7.28.0
3 changes: 2 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,11 @@
"requests==2.28.1",
"alive-progress==2.4.1",
]
__version__ = "0.2.2"

setup(
name="PyNews",
version="0.2.2",
version=__version__,
description=description,
long_description=long_description,
long_description_content_type="text/x-rst",
Expand Down

0 comments on commit 8bba500

Please sign in to comment.