Skip to content

Commit

Permalink
build on mac, windows and push to pypi on release (#331)
Browse files Browse the repository at this point in the history
* build on mac

* rename for easier fixes

* add black

* remove travis file

* testing a deployment
  • Loading branch information
Leah Wasser authored Nov 20, 2020
1 parent ae886a7 commit a6b3acc
Show file tree
Hide file tree
Showing 5 changed files with 75 additions and 35 deletions.
41 changes: 41 additions & 0 deletions .github/workflows/mac-python-package.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
# This workflow will install Python dependencies, run tests and lint with a variety of Python versions
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions

name: Mac Run Pytest & Build Docs

on:
push:
branches:
- '*'
pull_request:
branches:
- '*'

jobs:
build:

runs-on: windows-latest
strategy:
matrix:
python-version: [3.6, 3.7, 3.8]

steps:
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r dev-requirements.txt
pip install -e .
- name: Test with pytest
run: |
pytest
- name: Build Docs
run: |
make -B docs
- name: Linting
run: |
black --check --verbose .
31 changes: 31 additions & 0 deletions .github/workflows/publish-pypi.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# This workflows 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: 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.x'
- 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/*
5 changes: 2 additions & 3 deletions .github/workflows/windows-python-package.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# This workflow will install Python dependencies, run tests and lint with a variety of Python versions
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions

name: Python package
name: Windows Run Pytest

on:
push:
Expand All @@ -13,8 +13,7 @@ on:

jobs:
build:

runs-on: windows-latest
runs-on: macos-latest
strategy:
matrix:
python-version: [3.6, 3.7, 3.8]
Expand Down
32 changes: 0 additions & 32 deletions .travis.yml

This file was deleted.

1 change: 1 addition & 0 deletions dev-requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,4 @@ sphinx==3.2.1
sphinx-autobuild==2020.9.1
sphinx_copybutton==0.3.0
pydata_sphinx_theme==0.4.1
black

0 comments on commit a6b3acc

Please sign in to comment.