Skip to content

Commit

Permalink
Setup GitHub Actions.
Browse files Browse the repository at this point in the history
  • Loading branch information
jackz314 committed May 11, 2021
1 parent c091379 commit 5416e8f
Show file tree
Hide file tree
Showing 4 changed files with 65 additions and 3 deletions.
56 changes: 56 additions & 0 deletions .github/workflows/test_publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
# This workflow will upload a Python Package using Twine when a release is created
# For more information see: https://help.github.com/en/actions/language-and-framework-guides/using-python-with-github-actions#publishing-to-package-registries

name: Test & Publish

on:
push:
paths-ignore:
- '**/README.md'
- 'doc/*'
pull_request:
paths-ignore:
- '**/README.md'
- 'doc/*'

jobs:
test-publish:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: '3.x'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install mne flake8 pytest
pip install -r requirements.txt
- name: Lint
run: |
flake8 .
- name: Test
run: |
pytest
- name: Build Package
if: github.event_name == 'push' && (github.ref == 'refs/heads/stable' || startsWith(github.ref, 'refs/tags/v'))
run: |
pip install setuptools wheel twine
python setup.py sdist bdist_wheel
- name: Publish to Test PyPI
if: github.event_name == 'push' && github.ref == 'refs/heads/stable'
env:
TWINE_USERNAME: __token__
TWINE_PASSWORD: ${{ secrets.TEST_PYPI_API_TOKEN }}
run: |
twine upload --repository testpypi dist/*
- name: Publish to PyPI (release)
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v')
env:
TWINE_USERNAME: __token__
TWINE_PASSWORD: ${{ secrets.PYPI_API_TOKEN }}
run: |
twine upload dist/*
8 changes: 7 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,13 @@ Install from [PyPI](https://pypi.org/project/eeglabio):
pip install eeglabio
```

Or install the latest version of the code (unstable) from GitHub directly:
Install from [Test PyPI](https://test.pypi.org/project/eeglabio) (unreleased):

```
pip install -i https://test.pypi.org/simple/ eeglabio
```

Install the latest version of the code from GitHub directly (unstable):

```
pip install https://github.com/jackz314/eeglabio/archive/main.zip
Expand Down
2 changes: 1 addition & 1 deletion eeglabio/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@
from . import raw
from . import utils

__all__ = ['epochs', 'raw', 'utils']
__all__ = ['__version__', 'epochs', 'raw', 'utils']
2 changes: 1 addition & 1 deletion eeglabio/_version.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
"""The version number."""

__version__ = '0.0.1-5'
__version__ = '0.0.1-6'

0 comments on commit 5416e8f

Please sign in to comment.