Skip to content

Commit

Permalink
Merge pull request #97 from ocefpaf/GHA_take2
Browse files Browse the repository at this point in the history
  • Loading branch information
ocefpaf authored Mar 17, 2021
2 parents ef3d445 + 79045d1 commit 8c97f5e
Show file tree
Hide file tree
Showing 3 changed files with 48 additions and 46 deletions.
47 changes: 47 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
name: Publish to PyPI

on:
release:
types:
- published

jobs:
packages:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2

- name: Set up Python
uses: actions/setup-python@v1
with:
python-version: 3.8

- name: Get tags
run: git fetch --depth=1 origin +refs/tags/*:refs/tags/*
shell: bash

- name: Install build tools
run: |
python -m pip install --upgrade pip wheel setuptools setuptools_scm build twine pytest numpy scipy
shell: bash

- name: Build binary wheel
run: python -m build --sdist --wheel . --outdir dist

- name: CheckFiles
run: |
ls dist
shell: bash

- name: Test wheels
run: |
cd dist && python -m pip install UTide*.whl
python -m twine check *
shell: bash

- name: Publish a Python distribution to PyPI
uses: pypa/gh-action-pypi-publish@master
with:
user: __token__
password: ${{ secrets.PYPI_PASSWORD }}
1 change: 1 addition & 0 deletions .github/workflows/tarball-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ jobs:
shell: bash -l {0}
run: |
source activate TEST
python setup.py --version
pip wheel . -w dist --no-deps
check-manifest --verbose
twine check dist/*
46 changes: 0 additions & 46 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,21 +9,8 @@ env:
matrix:
fast_finish: true
include:
- name: "python-3.9 numpy 1.20"
env: PY=3.9 NP=1.20
- name: "python-3.8 numpy=1.17"
env: PY=3.8 NP=1.17
- name: "python-3.7"
env: PY=3.7
- name: "coding_standards"
env: PY=3
- name: "docs"
env: PY=3
- name: "tarball"
env: PY=3
allow_failures:
- name: "coding_standards"
env: PY=3

before_install:
# Install miniconda and create TEST env.
Expand All @@ -38,30 +25,11 @@ before_install:
conda config --set safety_checks disabled
conda create --name TEST python=$PY --file requirements.txt --file requirements-dev.txt
source activate TEST
if [[ -n "$NP" ]]; then
conda install numpy=$NP
fi
install:
- pip install -e . --no-deps --force-reinstall

script:
- if [[ $TRAVIS_JOB_NAME == python-* ]]; then
cp -r tests/ /tmp ;
pushd /tmp && pytest -n 2 -rxs --cov=utide tests && popd ;
fi

- if [[ $TRAVIS_JOB_NAME == 'tarball' ]]; then
python setup.py --version ;
pip wheel . -w dist --no-deps ;
check-manifest --verbose ;
twine check dist/* ;
fi

- if [[ $TRAVIS_JOB_NAME == 'coding_standards' ]]; then
pytest --flake8 -m flake8 ;
fi

- |
if [[ $TRAVIS_JOB_NAME == 'docs' ]]; then
set -e
Expand All @@ -75,17 +43,3 @@ script:
python -m doctr deploy --build-tags --key-path github_deploy_key_wesleybowman_utide.enc --built-docs docs/_build/html .
fi
fi
deploy:
skip_cleanup: true
provider: pypi
user: ocefpaf
password:
secure: "n7V/06zaWzAHiAx2YLh6n+glbRKHEdHntw8oOJXQJKQaiDzJR+Be2FANZ4rSof4kkDVUwwqTNzAuVn43BJBt4WdKdh3PWZwhfm4+/lzN1lpwyhK+P/5IUxSynov2JcqzvJtmrGCELEqrULBvrbBbcf9f93NPUr6Id5iA0shKv4w="
distributions: sdist bdist_wheel
upload_docs: no
on:
repo: wesleybowman/UTide
tags: true
all_branches: master
condition: '$TRAVIS_JOB_NAME == "tarball"'

0 comments on commit 8c97f5e

Please sign in to comment.