Skip to content

Commit

Permalink
Automate releases
Browse files Browse the repository at this point in the history
  • Loading branch information
Nelson-Gon committed May 30, 2021
1 parent d7f7b7b commit 430027d
Show file tree
Hide file tree
Showing 3 changed files with 59 additions and 9 deletions.
16 changes: 12 additions & 4 deletions .github/CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,14 @@ This document provides guidelines for contributions to `pyautocv`.

**Fixing typos and enhancing documentation**

To fix typos and/or grammatical errors, please edit the corresponding `.py` or `.md` file that generates the documentation.
To fix typos and/or grammatical errors, please edit the corresponding `.py` or `.md` file that
generates the documentation.

Please also update the docs using `sphinx`
Please also update documentation by running `bash scripts/mkdocs.sh` as described also later.

**Pull Requests**

* Please raise an issue for discussion and reproducibility checks at [issues](https://github.com/Nelson-Gon/pyautocv/issues)
* Please raise an issue for discussion and reproducibility checks at https://github.com/Nelson-Gon/pyautocv/issues

* Once the bug/enhancement is approved, please create a Git branch for the pull request.

Expand All @@ -33,13 +34,21 @@ Please also update the docs using `sphinx`
bash scripts/mkdocs.sh
```

[See also](https://samnicholls.net/2016/06/15/how-to-sphinx-readthedocs/) for a guide on Sphinx documentation.

**Commit messages**

Please write commit messages in the format "Extends functionality" instead of "Extended functionality".


**Maintainers only notice**


**Releasing**

This should ideally not be run since we are auto-releasing via a GitHub action. If for some reason you would like to
release a new version manually, then:

```shell
bash scripts/release.sh
```
Expand All @@ -54,4 +63,3 @@ Please note that the 'pyautocv' project is released with a
[Contributor Code of Conduct](https://github/com/Nelson-Gon/pyautocv/.github/CODE_OF_CONDUCT.md).
By contributing to this project, you agree to abide by its terms.

[See also](https://samnicholls.net/2016/06/15/how-to-sphinx-readthedocs/) for a guide on Sphinx documentation.
36 changes: 36 additions & 0 deletions .github/workflows/publish-package.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# Uploads package to pypi

name: Upload Python Package

on:
release:
types: [created]

jobs:
deploy:

runs-on: ubuntu-latest
strategy:
matrix:
python-version: [3.6]

steps:
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v1
with:
python-version: ${{ matrix.python-version }}


- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install setuptools wheel twine
- name: Build and publish
env:
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
run: |
python setup.py sdist bdist_wheel
twine upload dist/*
16 changes: 11 additions & 5 deletions docs/source/CONTRIBUTING.rst
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,16 @@ This document provides guidelines for contributions to ``pyautocv``.

**Fixing typos and enhancing documentation**

To fix typos and/or grammatical errors, please edit the corresponding ``.py`` or ``.md`` file that generates the documentation.
To fix typos and/or grammatical errors, please edit the corresponding ``.py`` or ``.md`` file that
generates the documentation.

Please also update the docs using ``sphinx``
Please also update documentation by running ``bash scripts/mkdocs.sh`` as described also later.

**Pull Requests**


*
Please raise an issue for discussion and reproducibility checks at `issues <https://github.com/Nelson-Gon/pyautocv/issues>`_
Please raise an issue for discussion and reproducibility checks at https://github.com/Nelson-Gon/pyautocv/issues

*
Once the bug/enhancement is approved, please create a Git branch for the pull request.
Expand All @@ -39,12 +40,19 @@ Please also update the docs using ``sphinx``
bash scripts/mkdocs.sh
`See also <https://samnicholls.net/2016/06/15/how-to-sphinx-readthedocs/>`_ for a guide on Sphinx documentation.

**Commit messages**

Please write commit messages in the format "Extends functionality" instead of "Extended functionality".

**Maintainers only notice**

**Releasing**

This should ideally not be run since we are auto-releasing via a GitHub action. If for some reason you would like to
release a new version manually, then:

.. code-block:: shell
bash scripts/release.sh
Expand All @@ -60,5 +68,3 @@ The above does the following:
Please note that the 'pyautocv' project is released with a
`Contributor Code of Conduct <https://github/com/Nelson-Gon/pyautocv/.github/CODE_OF_CONDUCT.md>`_.
By contributing to this project, you agree to abide by its terms.

`See also <https://samnicholls.net/2016/06/15/how-to-sphinx-readthedocs/>`_ for a guide on Sphinx documentation.

0 comments on commit 430027d

Please sign in to comment.