From 30306d0f575d610ba2000bd9a6ef77c8089121d6 Mon Sep 17 00:00:00 2001 From: Hugo van Kemenade Date: Fri, 20 Nov 2020 18:15:33 +0200 Subject: [PATCH] Replace Travis CI with GitHub Actions --- .github/workflows/deploy.yml | 52 ++++++++++++++++++++++++++ .travis.yml | 71 ------------------------------------ README.rst | 8 ++-- tox.ini | 9 +---- 4 files changed, 57 insertions(+), 83 deletions(-) create mode 100644 .github/workflows/deploy.yml delete mode 100644 .travis.yml diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml new file mode 100644 index 000000000..da3e49123 --- /dev/null +++ b/.github/workflows/deploy.yml @@ -0,0 +1,52 @@ +name: Deploy + +on: + push: + branches: + - master + release: + types: + - published + +jobs: + build: + if: github.repository == 'jazzband/pip-tools' + runs-on: ubuntu-20.04 + + steps: + - uses: actions/checkout@v2 + with: + fetch-depth: 0 + + - name: Cache + uses: actions/cache@v2 + with: + path: ~/.cache/pip + key: deploy-${{ hashFiles('**/setup.py') }} + restore-keys: | + deploy- + + - name: Set up Python + uses: actions/setup-python@v2 + with: + python-version: 3.9 + + - name: Install dependencies + run: | + python -m pip install -U pip + python -m pip install -U setuptools twine wheel + + - name: Build package + run: | + python setup.py --version + python setup.py sdist --format=gztar bdist_wheel + twine check dist/* + + - name: Publish package to Jazzband + if: github.event.action == 'published' + uses: pypa/gh-action-pypi-publish@master + + with: + user: jazzband + password: ${{ secrets.JAZZBAND_RELEASE_KEY }} + repository_url: https://jazzband.co/projects/pip-tools/upload diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 44ab4a13d..000000000 --- a/.travis.yml +++ /dev/null @@ -1,71 +0,0 @@ -dist: xenial -sudo: false -language: python -python: - - "2.7" - - "3.5" - - "3.6" - - "3.7" - - "3.8" - -env: - # NOTE: keep this in sync with envlist in tox.ini for tox-travis. - - PIP=latest - - PIP=20.1 - -cache: false -install: - - travis_retry python -m pip install -U tox-travis virtualenv -script: - - tox - -stages: -- test -- name: deploy - if: repo = jazzband/pip-tools AND tag IS present - -jobs: - include: - # QA checks. - - env: TOXENV=checkqa - python: 3.7 - after_success: skip # No need coverage - cache: - directories: - - $HOME/.cache/pre-commit - - env: TOXENV=readme - python: 2.7 - after_success: skip # No need coverage - - # Only test pypy/pypy3 with latest pip. - - env: PIP=latest - python: "pypy2.7-6.0" - - env: PIP=latest - python: "pypy3.5-6.0" - - - stage: deploy - install: skip # No need to install tox-travis on deploy. - script: skip # No test on the deploy stage. - python: 2.7 - env: skip # No special env required. - after_success: true # No need coverage - deploy: - provider: pypi - user: jazzband - server: https://jazzband.co/projects/pip-tools/upload - distributions: sdist bdist_wheel - password: - secure: TCG9beQgarL/EDHiwSCgEf1JnofTroA5QRp2OTL3QC+eaar6FftqxcJQw3FwnHJ7NarI6E7bcxn9wDRs6tXqiLcyGOzWUnR4jQ94w/7YaLQjzLr8g1toRnb9dNwU1l14z2hmnzc4oRqu7+pi4wIpBx+11Ke9JXNcrC+cRFwCdLQ= - on: - tags: true - repo: jazzband/pip-tools - allow_failures: - - env: PIP=master - -after_success: - - travis_retry pip install codecov coveralls - - travis_retry codecov --required -n "py${TRAVIS_PYTHON_VERSION}-pip${PIP}-${TRAVIS_OS_NAME}" - - "COVERALLS_PARALLEL=true coveralls" - -notifications: - webhooks: https://coveralls.io/webhook diff --git a/README.rst b/README.rst index 314eeaf2c..fbd160242 100644 --- a/README.rst +++ b/README.rst @@ -1,4 +1,4 @@ -|jazzband| |pypi| |pyversions| |buildstatus-travis| |buildstatus-appveyor| |codecov| +|jazzband| |pypi| |pyversions| |buildstatus-gha| |buildstatus-appveyor| |codecov| ================================== pip-tools = pip-compile + pip-sync @@ -10,9 +10,9 @@ even when you've pinned them. You do pin them, right? (In building your Python .. image:: https://github.com/jazzband/pip-tools/raw/master/img/pip-tools-overview.png :alt: pip-tools overview for phase II -.. |buildstatus-travis| image:: https://img.shields.io/travis/jazzband/pip-tools/master.svg?logo=travis - :alt: Travis CI build status - :target: https://travis-ci.org/jazzband/pip-tools +.. |buildstatus-gha| image:: https://github.com/jazzband/pip-tools/workflows/CI/badge.svg + :alt: GitHub Actions build status + :target: https://github.com/jazzband/pip-tools/actions?query=workflow%3ACI .. |buildstatus-appveyor| image:: https://img.shields.io/appveyor/ci/jazzband/pip-tools/master.svg?logo=appveyor :alt: AppVeyor build status :target: https://ci.appveyor.com/project/jazzband/pip-tools diff --git a/tox.ini b/tox.ini index da3c82742..f8b19a095 100644 --- a/tox.ini +++ b/tox.ini @@ -1,6 +1,6 @@ [tox] envlist = - # NOTE: keep this in sync with the env list in .travis.yml for tox-travis. + # NOTE: keep this in sync with the env list in .github/workflows/ci.yml. py{27,35,36,37,38,39,py,py3}-pip{20.1,20.2,latest,master}-coverage checkqa readme @@ -39,10 +39,3 @@ commands = pre-commit run --all-files --show-diff-on-failure deps = twine commands_pre = commands = twine check {distdir}/* - -[travis:env] -PIP = - 20.1: pip20.1 - 20.2: pip20.2 - latest: piplatest - master: pipmaster