From c3ed52910ca22f495608c64af1f26f2d5f42b130 Mon Sep 17 00:00:00 2001 From: p1c2u Date: Sun, 31 Jan 2021 12:27:40 +0000 Subject: [PATCH 1/2] Publish python package github action --- .github/workflows/python-publish.yml | 29 ++++++++++++++++++++++++++++ .travis.yml | 8 -------- 2 files changed, 29 insertions(+), 8 deletions(-) create mode 100644 .github/workflows/python-publish.yml diff --git a/.github/workflows/python-publish.yml b/.github/workflows/python-publish.yml new file mode 100644 index 0000000..7c7d8b5 --- /dev/null +++ b/.github/workflows/python-publish.yml @@ -0,0 +1,29 @@ +# This workflow will upload a Python Package using Twine when a release is created +# For more information see: https://help.github.com/en/actions/language-and-framework-guides/using-python-with-github-actions#publishing-to-package-registries + +name: Upload Python Package + +on: + release: + types: [created] + +jobs: + deploy: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - name: Set up Python + uses: actions/setup-python@v2 + with: + python-version: '3.x' + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install setuptools wheel twine + - name: Build and publish + env: + TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }} + TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }} + run: | + python setup.py sdist bdist_wheel + twine upload dist/* diff --git a/.travis.yml b/.travis.yml index 6ef58da..6606c9b 100644 --- a/.travis.yml +++ b/.travis.yml @@ -23,11 +23,3 @@ script: - python setup.py test after_success: - codecov -deploy: - provider: pypi - user: p1c2u - password: - secure: mQCKjaqTpkDhTRCSZtdt5d3tOs/d1vc8PDAna5Gr5prMbosq5stG3HdTK3qK5AbfNghclFYZH726zD2i4LdBWmHoA50TJn6mud3k0Byt+fEpnFIHgb8B2hhOQiiG/LxO1X+oRQI+2NL6TQagxJZzSArqaY4p83RAoLNjlf8LpgQu6qjERFkxMaSCrDfDWJ8MBFINMiZ5ZCq3NF8Rclaesv7HKAaYc8591grjouR8FBoVIPG7EWCZP8lp4CVEz6XlBZV8DDmUuhIhqWRkf6jS1zMbd0fUB7iKh2vHDHSWx9kGsxSRCqISDy3ywVUcee6O5M06RwzlpDSML+vuBHYvr8KX5LWSoaOcZfRNjGYIv437t+81Bl1d34GogI/Abm8WxG92KYt5+//6bKk7byck76ZLvuxV/lPtLjg0Caya9zVk/SE0GEa5N+Da04SHJqML88dS9ImbKchOnP1nUb/oUFA8SADFaMonxLbqe2k+PTLymZVTv0apPpiDXKpUF0K1+1WdggDRyr9WFhoBB7KYme6uQLLi78vmDo4gZzG+NvPYoux/VVsbm+upZdqRFL1jX8GGYMu/VbFwN3EHCAH3b6kFZFijZuTgCsIGvMfU2j/tJpLGUJLN8uLJlN88PqPxU4iz7lVKRU29hLwnCWY9yjPdTCZn0gdcZuosv6leNlc= - distributions: sdist bdist_wheel - on: - tags: true From 6a04ceddf8e8117bf684f9c19474e98b8f96f1ea Mon Sep 17 00:00:00 2001 From: p1c2u Date: Sun, 31 Jan 2021 12:35:31 +0000 Subject: [PATCH 2/2] Test python github action --- .github/workflows/python-test.yml | 33 +++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 .github/workflows/python-test.yml diff --git a/.github/workflows/python-test.yml b/.github/workflows/python-test.yml new file mode 100644 index 0000000..c0c6774 --- /dev/null +++ b/.github/workflows/python-test.yml @@ -0,0 +1,33 @@ +# This workflow will install Python dependencies, run tests and lint with a variety of Python versions +# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions + +name: Python test + +on: + push: + pull_request: + types: [opened, synchronize] + +jobs: + test: + runs-on: ubuntu-latest + strategy: + matrix: + python-version: [2.7, 3.5, 3.6, 3.7, 3.8, 3.9] + fail-fast: false + steps: + - uses: actions/checkout@v2 + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v2 + with: + python-version: ${{ matrix.python-version }} + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install -r requirements.txt + pip install -r requirements_dev.txt + pip install -e . + - name: Test + run: python setup.py test + - name: Upload coverage + uses: codecov/codecov-action@v1