From d2ae54cff2d153462b1dbbe75804d64bc01efc6e Mon Sep 17 00:00:00 2001 From: Aditya Vaidyam Date: Wed, 13 Jan 2021 13:46:42 -0500 Subject: [PATCH] Add CI/CD pipeline via GitHub Actions. --- .github/workflows/publish.yml | 35 +++++++++++++++++++++++++++++++++++ LAMP/__init__.py | 2 +- setup.py | 4 +++- 3 files changed, 39 insertions(+), 2 deletions(-) create mode 100644 .github/workflows/publish.yml diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml new file mode 100644 index 0000000..8b7f62f --- /dev/null +++ b/.github/workflows/publish.yml @@ -0,0 +1,35 @@ +name: Upload Python Package +on: + release: + types: [created] +jobs: + deploy: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - name: Set up Python + uses: actions/setup-python@v2 + with: + python-version: '3.9' + - name: Autoincrement version + run: | + # from refs/tags/v1.2.3 get 1.2.3 + VERSION=$(echo $GITHUB_REF | sed 's#.*/##') + PLACEHOLDER='__version__ = "develop"' + VERSION_FILE='setup.py' + # ensure the placeholder is there or abort if not found + grep "$PLACEHOLDER" "$VERSION_FILE" + sed -i "s/$PLACEHOLDER/__version__ = \"${VERSION}\"/g" "$VERSION_FILE" + echo VERSION + shell: bash + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install setuptools wheel twine + - name: Build and publish + env: + TWINE_USERNAME: '__token__' + TWINE_PASSWORD: ${{ secrets.PYPI_AUTH_TOKEN }} + run: | + python setup.py sdist bdist_wheel + twine upload dist/* diff --git a/LAMP/__init__.py b/LAMP/__init__.py index 2c7e8a0..92a2263 100644 --- a/LAMP/__init__.py +++ b/LAMP/__init__.py @@ -12,7 +12,7 @@ from __future__ import absolute_import -__version__ = "1.0.0" +__version__ = "develop" # import apis into sdk package from LAMP.api.api_api import APIApi diff --git a/setup.py b/setup.py index 360955f..6245073 100644 --- a/setup.py +++ b/setup.py @@ -11,9 +11,11 @@ from setuptools import setup, find_packages +__version__ = "develop" + setup( name="LAMP_core", - version="1.0.4", + version=__version__, description="LAMP Platform", author="Division of Digital Psychiatry at Beth Israel Deaconess Medical Center.", author_email="team@digitalpsych.org",