Skip to content

Commit

Permalink
pypi release, removed travis, added contributing guidelines
Browse files Browse the repository at this point in the history
  • Loading branch information
Scott Havens committed May 3, 2021
1 parent 055d367 commit 3e0a7c8
Show file tree
Hide file tree
Showing 5 changed files with 66 additions and 36 deletions.
52 changes: 52 additions & 0 deletions .github/workflows/new_pypi_release.yml
Original file line number Diff line number Diff line change
@@ -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/
5 changes: 2 additions & 3 deletions .github/workflows/unittest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,8 @@ name: Unittest, flake8

# Run action on pull requests
on:
[push]
# pull_request:
# branches: [main]
pull_request:
branches: [master]

jobs:
flake8:
Expand Down
29 changes: 0 additions & 29 deletions .travis.yml

This file was deleted.

13 changes: 12 additions & 1 deletion CONTRIBUTING.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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 <https://pypi.org/>`_, follow these steps:

#. Create a new release for inicheck
#. Name the tag and release the version number, for example `v0.9.1 <https://github.com/USDA-ARS-NWRC/inicheck/releases/tag/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
----

Expand Down
3 changes: 0 additions & 3 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit 3e0a7c8

Please sign in to comment.