Compare commits

..

6 Commits

Author SHA1 Message Date
f4c9b7b6b6 Update ci.yml 2024-04-01 20:38:16 +02:00
5b3389e939 Added manual triggering of the action 2024-04-01 20:33:34 +02:00
7eabeb3e04 Moved to tagging without prefix 2024-04-01 20:31:45 +02:00
51d4e7e6b8 Reworked CI 2024-04-01 20:28:16 +02:00
3fc6ae51c3 Added todos 2024-04-01 20:19:43 +02:00
525af5b34d Merged workflows 2024-04-01 20:19:02 +02:00
4 changed files with 35 additions and 35 deletions

View File

@@ -1,4 +1,4 @@
name: Lint and tag
name: Lint, Test, Tag & Publish
on:
push:
@@ -10,6 +10,7 @@ on:
- "**/.vscode/**"
- "**/README.md"
- "**/CHANGELOG.md"
workflow_dispatch:
jobs:
lint:
@@ -39,11 +40,16 @@ jobs:
- run: python -m pip install -r requirements.txt
- run: python test.py
tag:
tag_and_publish:
runs-on: ubuntu-latest
needs: test
permissions:
id-token: write # IMPORTANT: this permission is mandatory for trusted publishing
steps:
- uses: actions/checkout@v4
with:
fetch-tags: true
- name: setup git
run: |
@@ -54,12 +60,30 @@ jobs:
uses: codacy/git-version@2.8.0
id: git_version
with:
prefix: v
minor-identifier: "feat:"
major-identifier: "breaking:"
- name: Create Tag
run: git tag -a ${{ steps.git_version.outputs.version }} -m "${{ steps.git_version.outputs.version }}"
run: git tag ${{ steps.git_version.outputs.version }}
- name: Push Tag
run: git push origin ${{ steps.git_version.outputs.version }}
- uses: stefanzweifel/git-auto-commit-action@v5
with:
commit_message: Add new tag
push_options: --tags
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.12'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.build.txt
python setup.py sdist bdist_wheel
- name: Build and publish
uses: pypa/gh-action-pypi-publish@release/v1
with:
user: __token__
password: ${{ secrets.PYPI_API_TOKEN }}

View File

@@ -1,29 +0,0 @@
name: Publish to pypi
on:
push:
tags:
- '*'
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.12'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.build.txt
- name: Build and publish
uses: pypa/gh-action-pypi-publish@release/v1
with:
user: __token__
password: ${{ secrets.PYPI_API_TOKEN }}

View File

@@ -19,6 +19,7 @@ def get_object_or_404(db_class: Type[T], id: UUID | str, db: Session, expunge: b
return obj
# TODO: Add testing
def create_obj_from_data(
data: BaseModel, model: Type[T], db: Session, additonal_data={}, exclude={}
) -> T:
@@ -29,6 +30,7 @@ def create_obj_from_data(
return obj
# TODO: Add testing
def update_obj_from_data(
data: BaseModel,
model: Type[T],
@@ -50,6 +52,7 @@ def update_obj_from_data(
return obj
# TODO: Add testing
def delete_object(db_class: Type[T], id: UUID | str, db: Session) -> None:
obj = db.query(db_class).filter(db_class.id == id).one_or_none()
if obj is None:

View File

@@ -23,3 +23,5 @@ twine==5.0.0
urllib3==2.2.1
wheel==0.43.0
zipp==3.18.1
-r requirements.txt