-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #12 from NeonGeckoCom/dev
GitHub Automation, Minor Bugfixes
- Loading branch information
Showing
15 changed files
with
310 additions
and
28 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
# This workflow will generate a release distribution and upload it to PyPI | ||
|
||
name: Publish Docker Image | ||
on: | ||
push: | ||
branches: | ||
- master | ||
workflow_run: | ||
workflows: | ||
- "Publish Alpha Build" | ||
types: | ||
- completed | ||
workflow_dispatch: | ||
|
||
env: | ||
REGISTRY: ghcr.io | ||
IMAGE_NAME: ${{ github.repository }} | ||
|
||
jobs: | ||
build_and_publish: | ||
runs-on: ubuntu-latest | ||
permissions: | ||
contents: read | ||
packages: write | ||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v2 | ||
|
||
- name: Log in to the Container registry | ||
uses: docker/login-action@f054a8b539a109f9f41c372932f1ae047eff08c9 | ||
with: | ||
registry: ${{ env.REGISTRY }} | ||
username: ${{ github.actor }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Get Version | ||
id: version | ||
run: | | ||
VERSION=$(sed "s/a/-a./" <<< $(python setup.py --version)) | ||
echo ::set-output name=version::${VERSION} | ||
env: | ||
image_name: ${{ env.IMAGE_NAME }} | ||
|
||
- name: Extract metadata for Docker | ||
id: meta | ||
uses: docker/metadata-action@v2 | ||
with: | ||
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} | ||
tags: | | ||
type=semver,pattern={{version}},value=${{ steps.version.outputs.version }} | ||
type=ref,event=branch | ||
- name: Build and push Docker image | ||
uses: docker/build-push-action@ad44023a93711e3deb337508980b4b5e9bcdc5dc | ||
with: | ||
context: . | ||
push: true | ||
tags: ${{ steps.meta.outputs.tags }} | ||
labels: ${{ steps.meta.outputs.labels }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
# 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: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Setup Python | ||
uses: actions/setup-python@v1 | ||
with: | ||
python-version: 3.8 | ||
- name: Install Build Tools | ||
run: | | ||
python -m pip install build wheel | ||
- name: Build Distribution Packages | ||
run: | | ||
python setup.py bdist_wheel | ||
- name: Publish to Test PyPI | ||
uses: pypa/gh-action-pypi-publish@master | ||
with: | ||
password: ${{secrets.PYPI_TOKEN}} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
# This workflow will generate a distribution and upload it to PyPI | ||
|
||
name: Publish Alpha Build | ||
on: | ||
push: | ||
branches: | ||
- dev | ||
paths-ignore: | ||
- 'version.py' | ||
workflow_dispatch: | ||
|
||
jobs: | ||
build_and_publish: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
with: | ||
ref: ${{ github.head_ref }} | ||
- name: Setup Python | ||
uses: actions/setup-python@v1 | ||
with: | ||
python-version: 3.8 | ||
- name: Install Build Tools | ||
run: | | ||
python -m pip install build wheel | ||
- name: Increment Version | ||
run: | | ||
VER=$(python setup.py --version) | ||
python version_bump.py | ||
- name: Push Version Change | ||
uses: stefanzweifel/git-auto-commit-action@v4 | ||
with: | ||
commit_message: Increment Version | ||
- name: Build Distribution Packages | ||
run: | | ||
python setup.py bdist_wheel | ||
- name: Publish to Test PyPI | ||
uses: pypa/gh-action-pypi-publish@master | ||
with: | ||
password: ${{secrets.PYPI_TOKEN}} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
# This workflow will generate a PR for changes in cert into master | ||
|
||
name: Pull to Master | ||
on: | ||
push: | ||
branches: | ||
- dev | ||
workflow_dispatch: | ||
|
||
jobs: | ||
pull_changes: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: pull-request-action | ||
uses: repo-sync/pull-request@v2 | ||
with: | ||
github_token: ${{ secrets.GITHUB_TOKEN }} | ||
pr_reviewer: 'neonreviewers' | ||
pr_assignee: 'neondaniel' | ||
pr_draft: true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
FROM python:3.8 | ||
|
||
ADD . /neon_api_proxy | ||
WORKDIR /neon_api_proxy | ||
RUN apt-get update && \ | ||
apt-get install -y \ | ||
gcc \ | ||
python3 \ | ||
python3-dev \ | ||
&& pip install wheel \ | ||
&& pip install . | ||
|
||
WORKDIR /config | ||
|
||
ENV NEON_API_PROXY_CONFIG_PATH /config/config.json | ||
ENV NEON_MQ_PROXY_CONFIG_PATH /config/config.json | ||
|
||
CMD ["neon_api_proxy"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
# NEON AI (TM) SOFTWARE, Software Development Kit & Application Development System | ||
# | ||
# Copyright 2008-2021 Neongecko.com Inc. | All Rights Reserved | ||
# | ||
# Notice of License - Duplicating this Notice of License near the start of any file containing | ||
# a derivative of this software is a condition of license for this software. | ||
# Friendly Licensing: | ||
# No charge, open source royalty free use of the Neon AI software source and object is offered for | ||
# educational users, noncommercial enthusiasts, Public Benefit Corporations (and LLCs) and | ||
# Social Purpose Corporations (and LLCs). Developers can contact [email protected] | ||
# For commercial licensing, distribution of derivative works or redistribution please contact [email protected] | ||
# Distributed on an "AS IS” basis without warranties or conditions of any kind, either express or implied. | ||
# Trademarks of Neongecko: Neon AI(TM), Neon Assist (TM), Neon Communicator(TM), Klat(TM) | ||
# Authors: Guy Daniels, Daniel McKnight, Regina Bloomstine, Elon Gasper, Richard Leeds | ||
# | ||
# Specialized conversational reconveyance options from Conversation Processing Intelligence Corp. | ||
# US Patents 2008-2021: US7424516, US20140161250, US20140177813, US8638908, US8068604, US8553852, US10530923, US10530924 | ||
# China Patent: CN102017585 - Europe Patent: EU2156652 - Patents Pending | ||
|
||
import urllib.parse | ||
|
||
from enum import Enum | ||
from neon_utils.log_utils import LOG | ||
from neon_utils.authentication_utils import find_neon_wolfram_key | ||
from neon_api_proxy.cached_api import CachedAPI | ||
|
||
|
||
class TestAPI(CachedAPI): | ||
""" | ||
API for querying Wolfram|Alpha. | ||
""" | ||
|
||
def __init__(self, api_key: str = None): | ||
super().__init__("Test") | ||
|
||
def handle_query(self, **kwargs) -> dict: | ||
""" | ||
Handles an incoming query and provides a response | ||
:return: dict containing `status_code`, `content`, `encoding` from URL response | ||
""" | ||
return {"status_code": 200, | ||
"content": "Success", | ||
"encoding": None} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
requests-cache==0.6.4 | ||
requests~=2.25 | ||
neon_utils>=0.6.1a6 | ||
neon_mq_connector @ git+https://github.com/neongeckocom/neon_mq_connector | ||
neon_mq_connector>=0.0.4 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.