Skip to content

Commit

Permalink
feat: Automate deployment pipeline
Browse files Browse the repository at this point in the history
  • Loading branch information
jefersondaniel committed Jan 19, 2023
1 parent 2f5bb8e commit 735b5ad
Show file tree
Hide file tree
Showing 8 changed files with 72 additions and 26 deletions.
38 changes: 38 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: Release

on:
push:
branches:
- main

jobs:
release:
runs-on: ubuntu-latest
steps:
- uses: google-github-actions/release-please-action@v3
id: release
with:
release-type: python
package-name: pydantic-mongo

- uses: actions/checkout@v3
if: ${{ steps.release.outputs.release_created }}

- name: Set up Python
uses: actions/setup-python@v4
if: ${{ steps.release.outputs.release_created }}
with:
python-version: 3.9

- name: Build
if: ${{ steps.release.outputs.release_created }}
run: |
python -m pip install --upgrade pip
pip install wheel build
python -m build
- name: Publish a Python distribution to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
if: ${{ steps.release.outputs.release_created }}
with:
password: ${{ secrets.PYPI_API_TOKEN }
10 changes: 6 additions & 4 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -1,23 +1,25 @@
name: Tests
on: push
on:
push:
pull_request:
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [3.7, 3.8, 3.9]
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements_test.txt
- name: Test & publish code coverage
uses: paambaati/codeclimate-action@v2.7.5
uses: paambaati/codeclimate-action@v3.2.0
env:
CC_TEST_REPORTER_ID: ${{secrets.CC_TEST_REPORTER_ID}}
with:
Expand Down
Empty file added CHANGELOG.md
Empty file.
4 changes: 0 additions & 4 deletions Makefile

This file was deleted.

1 change: 1 addition & 0 deletions pydantic_mongo/__init__.py
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
from .abstract_repository import AbstractRepository # noqa
from .fields import ObjectIdField # noqa
from .version import __version__ # noqa
1 change: 1 addition & 0 deletions pydantic_mongo/version.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
__version__ = "1.0.0"
4 changes: 2 additions & 2 deletions requirements_test.txt
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
mock
coverage==5.2.1
flake8==3.8.3
flake8==5.0.4
phulpy==1.0.10
pytest==5.4.3
pytest-cov==2.10.0
pytest-mock==3.2.0
mongomock==3.23.0
pydantic==1.8.2
pymongo==4.3.3
mypy==0.910
mypy==0.991
mypy-extensions==0.4.3
40 changes: 24 additions & 16 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,15 +1,23 @@
import os
from setuptools import setup

long_description = open('README.rst', 'r').read()
long_description = open("README.rst", "r").read()

package_root = os.path.abspath(os.path.dirname(__file__))

version = {}
with open(os.path.join(package_root, "pydantic_mongo/version.py")) as fp:
exec(fp.read(), version)
version = version["__version__"]

setup(
name='pydantic-mongo',
version='0.1.3',
packages=['pydantic_mongo'],
setup_requires=['wheel'],
name="pydantic-mongo",
version=version,
packages=["pydantic_mongo"],
setup_requires=["wheel"],
install_requires=[
'pymongo>=4.3,<5.0',
'pydantic>=1.6.2,<2.0.0'
"pymongo>=4.3,<5.0",
"pydantic>=1.6.2,<2.0.0"
],
entry_points={
"console_scripts": [
Expand All @@ -18,16 +26,16 @@
},
description="Document object mapper for pydantic and pymongo",
long_description=long_description,
url='https://github.com/jefersondaniel/pydantic-mongo',
author='Jeferson Daniel',
author_email='jeferson.daniel412@gmail.com',
license='MIT',
url="https://github.com/jefersondaniel/pydantic-mongo",
author="Jeferson Daniel",
author_email="jeferson.daniel412@gmail.com",
license="MIT",
classifiers=[
'License :: OSI Approved :: MIT License',
'Operating System :: OS Independent',
'Programming Language :: Python :: 3.7',
'Programming Language :: Python :: 3.8',
'Programming Language :: Python :: 3.9',
"License :: OSI Approved :: MIT License",
"Operating System :: OS Independent",
"Programming Language :: Python :: 3.7",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
],
python_requires=">=3.7"
)

0 comments on commit 735b5ad

Please sign in to comment.