Skip to content

Commit

Permalink
Added CI/CD and docker config
Browse files Browse the repository at this point in the history
  • Loading branch information
kirgrim committed Aug 29, 2023
1 parent 4d3184a commit 937c6bb
Show file tree
Hide file tree
Showing 9 changed files with 123 additions and 1 deletion.
12 changes: 12 additions & 0 deletions .github/workflows/license_tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
name: Run License Tests
on:
push:
workflow_dispatch:
pull_request:
branches:
- master
jobs:
license_tests:
uses: neongeckocom/.github/.github/workflows/license_tests.yml@master
with:
packages-exclude: '^(pyklatchat-client|tqdm).*'
27 changes: 27 additions & 0 deletions .github/workflows/propose_release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: Propose Stable Release
on:
workflow_dispatch:
inputs:
release_type:
type: choice
description: Release Type
options:
- patch
- minor
- major
jobs:
update_version:
uses: neongeckocom/.github/.github/workflows/propose_semver_release.yml@master
with:
branch: dev
release_type: ${{ inputs.release_type }}
update_changelog: True
pull_changes:
uses: neongeckocom/.github/.github/workflows/pull_master.yml@master
needs: update_version
with:
pr_reviewer: neonreviewers
pr_assignee: ${{ github.actor }}
pr_draft: false
pr_title: ${{ needs.update_version.outputs.version }}
pr_body: ${{ needs.update_version.outputs.changelog }}
25 changes: 25 additions & 0 deletions .github/workflows/publish_release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# This workflow will generate a release distribution and upload it to PyPI

name: Publish Build and GitHub Release
on:
push:
branches:
- master

jobs:
tag_release:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Get Version
run: |
VERSION=$(python setup.py --version)
echo "VERSION=${VERSION}" >> $GITHUB_ENV
- uses: ncipollo/release-action@v1
with:
token: ${{secrets.GITHUB_TOKEN}}
tag: ${{env.VERSION}}

build_and_publish_docker:
uses: neongeckocom/.github/.github/workflows/publish_docker.yml@master
secrets: inherit
22 changes: 22 additions & 0 deletions .github/workflows/publish_test_build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# This workflow will generate a distribution and upload it to PyPI

name: Publish Alpha Build
on:
push:
branches:
- dev
paths-ignore:
- 'version.py'

jobs:
publish_alpha_release:
uses: neongeckocom/.github/.github/workflows/publish_alpha_release.yml@master
secrets: inherit
with:
version_file: "version.py"
publish_prerelease: true
publish_pypi: false
build_and_publish_docker:
needs: publish_alpha_release
uses: neongeckocom/.github/.github/workflows/publish_docker.yml@master
secrets: inherit
12 changes: 12 additions & 0 deletions .github/workflows/unit_tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
name: Run Unit Tests
on:
pull_request:
workflow_dispatch:

jobs:
py_build_tests:
uses: neongeckocom/.github/.github/workflows/python_build_tests.yml@master
with:
python_version: "3.8"
docker_build_tests:
uses: neongeckocom/.github/.github/workflows/docker_build_tests.yml@master
15 changes: 15 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
FROM python:3.9-slim

LABEL vendor=neon.ai \
ai.neon.name="pyklatchat-client"

ENV OVOS_CONFIG_BASE_FOLDER neon
ENV OVOS_CONFIG_FILENAME diana.yaml
ENV XDG_CONFIG_HOME /config
COPY docker_overlay/ /

WORKDIR /app
COPY . /app
RUN pip install /app

CMD [ "pyklatchat_client" ]
Empty file.
7 changes: 7 additions & 0 deletions docker_overlay/etc/neon/diana.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
log_level: INFO
CHAT_CLIENT:
DEV:
SERVER_URL: "https://127.0.0.1:8000"
RUNTIME_CONFIG:
CHAT_SERVER_URL_BASE: "https://127.0.0.1:8000"
MAX_CONVERSATIONS_PER_PAGE: 3
4 changes: 3 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,8 @@ def get_requirements(requirements_filename: str):
name='pyklatchat_client',
version=version,
description='Klatchat Client v2.0',
long_description=long_description,
long_description_content_type="text/markdown",
url='https://github.com/NeonGeckoCom/pyklatchat-client',
author='NeonGecko',
author_email='[email protected]',
Expand All @@ -79,4 +81,4 @@ def get_requirements(requirements_filename: str):
'chat_client=chat_client.__main__:main',
]
}
)
)

0 comments on commit 937c6bb

Please sign in to comment.