Skip to content

Commit

Permalink
Add CI/CD pipeline via GitHub Actions.
Browse files Browse the repository at this point in the history
  • Loading branch information
avaidyam committed Jan 13, 2021
1 parent 59f7241 commit d2ae54c
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 2 deletions.
35 changes: 35 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -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/*
2 changes: 1 addition & 1 deletion LAMP/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 3 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -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="[email protected]",
Expand Down

0 comments on commit d2ae54c

Please sign in to comment.