From 3e0a7c8cf9724520ffb131f55e66244a16050c57 Mon Sep 17 00:00:00 2001 From: Scott Havens Date: Mon, 3 May 2021 09:40:41 -0600 Subject: [PATCH] pypi release, removed travis, added contributing guidelines --- .github/workflows/new_pypi_release.yml | 52 ++++++++++++++++++++++++++ .github/workflows/unittest.yml | 5 +-- .travis.yml | 29 -------------- CONTRIBUTING.rst | 13 ++++++- README.rst | 3 -- 5 files changed, 66 insertions(+), 36 deletions(-) create mode 100644 .github/workflows/new_pypi_release.yml delete mode 100644 .travis.yml diff --git a/.github/workflows/new_pypi_release.yml b/.github/workflows/new_pypi_release.yml new file mode 100644 index 0000000..3699133 --- /dev/null +++ b/.github/workflows/new_pypi_release.yml @@ -0,0 +1,52 @@ +name: Release to Pypi + +# Run on a published release and push to Pypi +on: + release: + types: [published] + +jobs: + build_dist: + name: Build source distribution + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + + - uses: actions/setup-python@v2 + name: Install Python + with: + python-version: "3.8" + + - name: Install dependencies + run: | + python3 -m pip install --upgrade pip wheel + python3 -m pip install -r requirements.txt + + - name: Build dist + run: python setup.py sdist --formats=gztar + + - name: Build wheel + run: python3 setup.py bdist_wheel + + - uses: actions/upload-artifact@v2 + with: + path: dist/*.tar.gz + + upload_pypi: + needs: [build_dist] + runs-on: ubuntu-latest + # upload to PyPI on every tag starting with 'v' + # if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags/v') + # alternatively, to publish when a GitHub Release is created, use the following rule: + if: github.event_name == 'release' && github.event.action == 'published' + steps: + - uses: actions/download-artifact@v2 + with: + name: artifact + path: dist + + - uses: pypa/gh-action-pypi-publish@master + with: + user: __token__ + password: ${{ secrets.pypi_password }} + # To test: repository_url: https://test.pypi.org/legacy/ diff --git a/.github/workflows/unittest.yml b/.github/workflows/unittest.yml index 93a67da..10f8011 100644 --- a/.github/workflows/unittest.yml +++ b/.github/workflows/unittest.yml @@ -2,9 +2,8 @@ name: Unittest, flake8 # Run action on pull requests on: - [push] - # pull_request: - # branches: [main] + pull_request: + branches: [master] jobs: flake8: diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 1b7d551..0000000 --- a/.travis.yml +++ /dev/null @@ -1,29 +0,0 @@ -language: python -python: - - 3.5 - - 3.6 - - 3.7 - - 3.8 - -install: - - pip install -U -r requirements_dev.txt - - python setup.py install - -script: - - py.test - -after_success: - - coverage run --source inicheck -m pytest - - coveralls - -deploy: - cleanup: true - provider: pypi - distributions: sdist bdist_wheel - skip_existing: true - username: __token__ - on: - tags: true - repo: USDA-ARS-NWRC/inicheck - password: - secure: JUpPaw+k6twC3dbgVuzkCCrwIl9ZAKVXOG5GpHWGsTapcYpJE1CvZD9puJ+ZKIvCASj/9XJwnVoYoG4XWxULhEN3hcQaH8gZMU6P0UdjiCmwm6RJGHAKEf6AGTsVbIWOeXxVl9R9kj0Jd6FYE+DYjn9UnCTXqDTSGoNcepmHwc56Qn2g6WgSGyKy3EgRe5jxJjQOS3SFJixysZHNwpaqRRNEVoh3nT6FGcY+O6iWF0GrplSiuiMDPgJDU+NU9DHqQmsOA6w7eL+TXhHYqr/ZDtHNspa1ZGMSzYXSYjk2gua6vUSEu895PBMkUp3CK6Jki7x/0hNcBhs+U+DZFrRPlX1vObKtjtoCuNhtXRoRLqUm5SAzVnLk9x4HvEnXFl3aHBz/aU0yWGXKUWH6jjxYyqFmIuHVDD9lIM0F8FoM1qDPH8pwABkg6xZLp3MaFbs9MAtLYe2MuFTa4Gvls/jvB2Ojaj5+7HqovxlD128YbZitcjqpD4sCt0L3nQDdhdNZbUjYKI7Mf9+vRrfi/Fpn4b091bezeXq4i7hA/b6FVDPqNODPa0N5yWdyjswboQV+ZBneVCGuoJguK3oAAqDctSu+LCnnsFpxHak5ByExAY+XUncop8tUqvN8Ixji643ice+jWQdzCSk1jNvA54RTzzVi7T9fGjI4g7zfvddZIE0= diff --git a/CONTRIBUTING.rst b/CONTRIBUTING.rst index ac9558b..17f6ed2 100644 --- a/CONTRIBUTING.rst +++ b/CONTRIBUTING.rst @@ -100,10 +100,21 @@ Before you submit a pull request, check that it meets these guidelines: 2. If the pull request adds functionality, the docs should be updated. Put your new functionality into a function with a docstring, and add the feature to the list in README.rst. -3. The pull request should work for Python 3.5, 3.6, 3.7, 3.8 and for PyPy. Check +3. The pull request should work for Python >= 3.6. Check https://github.com/USDA-ARS-NWRC/inicheck/pull_requests and make sure that the tests pass for all supported Python versions. + Releasing to PyPI + ----------------- + To create a new release on `Pypi.org `_, follow these steps: + + #. Create a new release for inicheck + #. Name the tag and release the version number, for example `v0.9.1 `_ + #. Add documentation about the release and why it's different from the previous. + Especially highlight any changes that will break existing integrations. + #. Publish new release which will trigger a build to release to PyPI + + Tips ---- diff --git a/README.rst b/README.rst index c43557a..77ff8cc 100644 --- a/README.rst +++ b/README.rst @@ -10,9 +10,6 @@ Welcome to inicheck :target: https://inicheck.readthedocs.io/en/latest/?badge=latest :alt: Documentation Status -.. image:: https://travis-ci.com/USDA-ARS-NWRC/inicheck.svg?branch=master - :target: https://travis-ci.com/USDA-ARS-NWRC/inicheck - .. image:: https://coveralls.io/repos/github/USDA-ARS-NWRC/inicheck/badge.svg?branch=master :target: https://coveralls.io/github/USDA-ARS-NWRC/inicheck?branch=master