diff --git a/.github/workflows/conventional-pr.yml b/.github/workflows/conventional-pr.yml new file mode 100644 index 0000000..976604a --- /dev/null +++ b/.github/workflows/conventional-pr.yml @@ -0,0 +1,18 @@ +name: conventional-pr +on: + pull_request: + types: + - opened + - edited + - synchronize + branches: + - master +jobs: + lint-pr: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + # check for the most recent release: https://github.com/CondeNast/conventional-pull-request-action/releases + - uses: CondeNast/conventional-pull-request-action@v0.1.2 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..9b4a36a --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,22 @@ +name: Release + +on: + workflow_dispatch: + # push: + # branches: + # - master + +jobs: + release: + runs-on: ubuntu-latest + environment: release + steps: + - uses: actions/checkout@v2 + with: + fetch-depth: 0 + - name: Python Semantic Release + # https://github.com/relekang/python-semantic-release/releases + uses: relekang/python-semantic-release@v7.23.0 + with: + github_token: ${{ secrets.GITHUB_TOKEN }} + pypi_token: ${{ secrets.PYPI_TOKEN }} diff --git a/pyproject.toml b/pyproject.toml index c6f1266..e93c0b0 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -31,3 +31,13 @@ coverage = "4.5.4" django-extensions = "2.2.3" factory-boy = "2.12.0" dj-database-url = "0.5.0" + +[build-system] +requires = ["poetry_core>=1.0.0"] +build-backend = "poetry.core.masonry.api" + +[tool.semantic_release] +branch = "master" +version_toml = "pyproject.toml:tool.poetry.version" +version_variable = "django-object-actions/__init__.py:__version__" +build_command = "pip install poetry && poetry build"