Skip to content

Commit 54c4a34

Browse files
chore: added auto-versioning
1 parent de95347 commit 54c4a34

File tree

3 files changed

+186
-8
lines changed

3 files changed

+186
-8
lines changed

.github/workflows/CD.yaml

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
name: Build, Version, and Publish Package
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
8+
jobs:
9+
build:
10+
runs-on: ubuntu-latest
11+
12+
steps:
13+
- name: Checkout code
14+
uses: actions/checkout@v2
15+
16+
- name: Set up Python
17+
uses: actions/setup-python@v2
18+
with:
19+
python-version: '3.9'
20+
21+
- name: Install Poetry
22+
run: |
23+
pip install --upgrade pip
24+
curl -sSL https://install.python-poetry.org | python3 -
25+
poetry config virtualenvs.create false
26+
poetry install
27+
28+
29+
- name: Increment version
30+
run: |
31+
poetry version patch # params: patch, minor, major
32+
git config --global user.name 'GitHub Actions'
33+
git config --global user.email '[email protected]'
34+
git commit -am "chore: Incremented version"
35+
git tag $(poetry version -s)
36+
git push origin --tags
37+
38+
- name: Build package
39+
run: poetry build
40+
41+
- name: Publish package to PyPI
42+
env:
43+
POETRY_PYPI_TOKEN_PYPI: ${{ secrets.PYPI_TOKEN }}
44+
run: poetry publish --username __token__ --password $POETRY_PYPI_TOKEN_PYPI

poetry.lock

Lines changed: 131 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pyproject.toml

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[tool.poetry]
22
name = "api-to-dataframe"
3-
version = "v0.0.3"
3+
version = "0.0.3"
44
description = "A package to convert API responses to pandas dataframe"
55
authors = ["IvanildoBarauna <[email protected]>"]
66
readme = "README.md"
@@ -14,14 +14,14 @@ classifiers=[
1414
"Programming Language :: Python :: 3.8",
1515
]
1616

17-
[tool.project.urls]
18-
url="https://github.com/IvanidoBarauna/api-to-dataframe"
19-
license="MIT"
20-
21-
[tool.poetry.dev-dependencies]
17+
[tool.poetry.group.dev.dependencies]
18+
poetry-dynamic-versioning = "^1.3.0"
2219
pytest = "^8.2.2"
2320
coverage = "^7.5.3"
2421

22+
[tool.project.urls]
23+
url="https://github.com/IvanidoBarauna/api-to-dataframe"
24+
license="MIT"
2525

2626
[tool.poetry.dependencies]
2727
python = "^3.9"
@@ -30,4 +30,8 @@ requests = "2.30.0"
3030

3131
[build-system]
3232
requires = ["poetry-core"]
33-
build-backend = "poetry.core.masonry.api"
33+
build-backend = "poetry.core.masonry.api"
34+
35+
[tool.poetry-dynamic-versioning]
36+
enable = true
37+
versioning = "semantic"

0 commit comments

Comments
 (0)