Skip to content

Commit

Permalink
Merge pull request #30 from c2corg/cd-process
Browse files Browse the repository at this point in the history
Use Gh action to publish releases
  • Loading branch information
cbeauchesne committed Nov 11, 2020
2 parents 0eea8c0 + b57027a commit 3d86447
Show file tree
Hide file tree
Showing 5 changed files with 57 additions and 3 deletions.
49 changes: 49 additions & 0 deletions .github/workflows/continuous-delivery.yml
@@ -0,0 +1,49 @@
name: continuous-delivery

on:
push:
branches:
- master'
tags:
- '**'


jobs:
build-and-publish:
name: Publish release to Pypi
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
- uses: actions/setup-python@v1

- name: Build package
run: |
python --version
pip install -r requirements.txt -r dev-requirements.txt
python setup.py sdist bdist_wheel
- name: Publish package to Test PyPI
uses: pypa/gh-action-pypi-publish@master
with:
user: __token__
password: ${{ secrets.test_pypi_password }}
repository_url: https://test.pypi.org/legacy/
skip_existing: true
- name: Test that package is published on Test PyPI
run: |
python -m venv venv
source venv/bin/activate
pip install --index-url https://test.pypi.org/simple/ --no-deps campbot
- name: Check that version number from source is equal to release version number
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags')
run: |
echo "Tag name is ${GITHUB_REF##*/}"
python -c "import campbot; print("Version is " + campbot.__version__)"
python -c "import campbot; exit(1 if campbot.__version__ != '${GITHUB_REF##*/}' else 0)"
- name: Publish package to PyPI
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags')
uses: pypa/gh-action-pypi-publish@master
with:
user: __token__
password: ${{ secrets.test_pypi_password }}
Expand Up @@ -25,7 +25,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
python_version: ["2.7", "3.5", "3.6", "3.7", "3.8"]
python_version: ["2.7", "3.5", "3.6", "3.7", "3.8", "3.9"]
steps:
- uses: actions/checkout@master
- name: Setup python
Expand Down
2 changes: 2 additions & 0 deletions campbot/__init__.py
Expand Up @@ -3,3 +3,5 @@
"""

from campbot.core import CampBot

__version__ = "1.3.1"
2 changes: 1 addition & 1 deletion dev-requirements.txt
@@ -1,4 +1,4 @@
pytest
pytest-cov
wheel
twine
setuptools
5 changes: 4 additions & 1 deletion setup.py
@@ -1,3 +1,4 @@
import campbot
from setuptools import setup, find_packages


Expand All @@ -6,7 +7,7 @@

setup(
name='campbot',
version="1.3.1",
version=campbot.__version__,
packages=find_packages(),
author="Charles de Beauchesne",
author_email="charles.de.beauchesne@gmail.com",
Expand All @@ -27,6 +28,8 @@
"Programming Language :: Python :: 3.5",
"Programming Language :: Python :: 3.6",
"Programming Language :: Python :: 3.7",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Topic :: Communications",
],

Expand Down

0 comments on commit 3d86447

Please sign in to comment.