Skip to content

Commit

Permalink
add pypi deployment (#34)
Browse files Browse the repository at this point in the history
* add pypi deployment

Add github action for automatic deployment to PyPI.

* bump version to 1.1.1
  • Loading branch information
ltalirz committed Mar 4, 2020
1 parent 0d32aad commit 40f731d
Show file tree
Hide file tree
Showing 5 changed files with 49 additions and 10 deletions.
40 changes: 40 additions & 0 deletions .github/workflows/publish-on-pypi.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: Publish on PyPI

on:
push:
tags:
# After vMajor.Minor.Patch _anything_ is allowed (without "/") !
- v[0-9]+.[0-9]+.[0-9]+*

jobs:
publish:
runs-on: ubuntu-latest
if: github.repository == 'aiidateam/aiida-diff' && startsWith(github.ref, 'refs/tags/v')

steps:
- name: Checkout repository
uses: actions/checkout@v2

- name: Set up Python 3.7
uses: actions/setup-python@v1
with:
python-version: 3.7

- name: Upgrade setuptools and install package
run: |
python -m pip install --upgrade pip setuptools
python -m pip install -e .
- name: Assert package version
env:
TAG_VERSION: ${{ github.ref }}
run: python ./.ci/check_version.py

- name: Build source distribution
run: python ./setup.py sdist

- name: Publish package to PyPI
uses: pypa/gh-action-pypi-publish@master
with:
user: __token__
password: ${{ secrets.pypi_token }}
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
[![Build Status](https://github.com/aiidateam/aiida-diff/workflows/ci/badge.svg?branch=master)](https://travis-ci.org/aiidateam/aiida-diff/actions)
[![Build Status](https://github.com/aiidateam/aiida-diff/workflows/ci/badge.svg?branch=master)](https://github.com/aiidateam/aiida-diff/actions)
[![Coverage Status](https://coveralls.io/repos/github/aiidateam/aiida-diff/badge.svg?branch=master)](https://coveralls.io/github/aiidateam/aiida-diff?branch=master)
[![Docs status](https://readthedocs.org/projects/aiida-diff/badge)](http://aiida-diff.readthedocs.io/)
[![PyPI version](https://badge.fury.io/py/aiida-diff.svg)](https://badge.fury.io/py/aiida-diff)
Expand All @@ -18,8 +18,9 @@ Plugins templated using the plugin cutter
* include basic regression tests using the [pytest](https://docs.pytest.org/en/latest/) framework ( (submitting a calculation, ...)
* can be directly pip-installed (and are prepared for submisson to [PyPI](https://pypi.org/)
* include a documentation template ready for [Read the Docs](http://aiida-diff.readthedocs.io/en/latest/)
* come with [Github Actions](https://github.com/features/actions) configuration - enable it to run tests and check test coverage at every commit
* come with pre-commit hooks that sanitize coding style and check for syntax errors - enable via `pre-commit install`
* come with [Github Actions](https://github.com/features/actions) configuration - enable it to run tests and check test coverage at every commit
* come with automatic deployment to PyPI - just generate a [PyPI API token](https://pypi.org/help/#apitoken) for your PyPI account and add it to the `pypi_token` secret of your github repository

For more information on how to take advantage of these features,
see the [developer guide](https://aiida-diff.readthedocs.io/en/latest/developer_guide) of your plugin.
Expand Down
2 changes: 1 addition & 1 deletion aiida_diff/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@
AiiDA demo plugin that wraps the `diff` executable for computing the difference between two files.
"""

__version__ = "1.0.0"
__version__ = "1.1.1"
10 changes: 4 additions & 6 deletions docs/source/developer_guide/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -31,16 +31,12 @@ If you ever need to skip these pre-commit hooks, just use::
Continuous integration
++++++++++++++++++++++

``aiida-diff`` comes with a ``.travis.yml`` file for continuous integration tests on every commit using `Travis CI <http://travis-ci.com/>`_. It will:
``aiida-diff`` comes with a ``.github`` folder that contains continuous integration tests on every commit using `GitHub Actions <https://github.com/features/actions>`_. It will:

#. run all tests for the ``django`` and ``sqlalchemy`` ORM
#. run all tests for the ``django`` ORM
#. build the documentation
#. check coding style and version number (not required to pass by default)

Just enable Travis builds for the ``aiida-diff`` repository in your Travis account.

``aiida-diff`` also includes an ``azure-pipelines.yml`` file for continuous integration tests using `Azure Pipelines <https://azure.microsoft.com/en-us/services/devops/pipelines/>`_.

Online documentation
++++++++++++++++++++

Expand All @@ -64,3 +60,5 @@ After this, you (and everyone else) should be able to::

pip install aiida-diff

You can also enable *automatic* deployment of git tags to the python package index:
simply generate a `PyPI API token <https://pypi.org/help/#apitoken>`_ for your PyPI account and add it as a secret to your GitHub repository under the name ``pypi_token`` (Go to Settings -> Secrets).
2 changes: 1 addition & 1 deletion setup.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
"Natural Language :: English",
"Framework :: AiiDA"
],
"version": "1.0.0",
"version": "1.1.1",
"entry_points": {
"aiida.data": [
"diff = aiida_diff.data:DiffParameters"
Expand Down

0 comments on commit 40f731d

Please sign in to comment.