Skip to content

Commit

Permalink
Added github actions for pypi push
Browse files Browse the repository at this point in the history
  • Loading branch information
jreniel committed Feb 23, 2021
1 parent a7a5278 commit 6231f69
Show file tree
Hide file tree
Showing 2 changed files with 70 additions and 4 deletions.
67 changes: 67 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
name: build

on:
release:
types:
- published

jobs:
build_wheels:
name: build wheel on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ ubuntu-latest ]
python-version: [ 3.8 ]
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Install Python
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Restore cached dependencies
uses: actions/cache@v2
with:
path: ~/.cache/pip
key: ${{ matrix.os }}-pip-${{ matrix.python-version }}-${{ hashFiles('setup.py') }}
restore-keys: ${{ matrix.os }}-pip-${{ matrix.python-version }}-
- name: Install dependencies
run: pip install --upgrade pip setuptools wheel
- name: Build wheel
run: python setup.py bdist_wheel
- name: Save wheel
uses: actions/upload-artifact@v2
with:
path: ./dist/*.whl
build_sdist:
name: package source
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Install Python
uses: actions/setup-python@v2
with:
python-version: '3.8'
- name: Package source
run: python setup.py sdist
- name: Save source package
uses: actions/upload-artifact@v2
with:
path: ./dist/*.tar.gz
upload_pypi:
name: publish wheel to PyPI
needs: [ build_wheels, build_sdist ]
runs-on: ubuntu-latest
steps:
- name: Retrieve wheel
uses: actions/download-artifact@v2
with:
name: artifact
path: dist
- name: Upload wheel
uses: pypa/gh-action-pypi-publish@master
with:
user: __token__
password: ${{ secrets.PYPI_TOKEN }}
7 changes: 3 additions & 4 deletions setup.cfg
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
[metadata]
name = pyschism
version = 0.0.0
author = "Jaime Calzada, Joseph Zhang"
author_email = [email protected]
author = "SCHISM development group"
author_email = [email protected]
description = Python package for working with SCHISM input and output files.
long_description = file: README.md
license = GPL
license = "Apache 2.0"
url = https://github.com/schism-dev/pyschism.git

[nosetests]
Expand Down

0 comments on commit 6231f69

Please sign in to comment.