From 6231f69b8fde8e2dc6b1a2a219ba5397e319ad63 Mon Sep 17 00:00:00 2001 From: Jaime R Calzada Date: Tue, 23 Feb 2021 08:47:01 -0500 Subject: [PATCH] Added github actions for pypi push --- .github/workflows/build.yml | 67 +++++++++++++++++++++++++++++++++++++ setup.cfg | 7 ++-- 2 files changed, 70 insertions(+), 4 deletions(-) create mode 100644 .github/workflows/build.yml diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 00000000..039ea6a7 --- /dev/null +++ b/.github/workflows/build.yml @@ -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 }} \ No newline at end of file diff --git a/setup.cfg b/setup.cfg index f0585669..ba38fbf0 100644 --- a/setup.cfg +++ b/setup.cfg @@ -1,11 +1,10 @@ [metadata] name = pyschism -version = 0.0.0 -author = "Jaime Calzada, Joseph Zhang" -author_email = Jaime.Calzada@noaa.gov +author = "SCHISM development group" +author_email = jreniel@gmail.com 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]