From 9dc0516683cfb20c366da044a7cff31c3abb075a Mon Sep 17 00:00:00 2001 From: Jannis Leidel Date: Thu, 26 Nov 2020 09:32:28 +0100 Subject: [PATCH] Add release workflow. --- .github/workflows/release.yml | 53 +++++++++++++++++++++++++++++++++++ .travis.yml | 24 ---------------- README.rst | 5 ++-- 3 files changed, 56 insertions(+), 26 deletions(-) create mode 100644 .github/workflows/release.yml delete mode 100644 .travis.yml diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..0976504 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,53 @@ +name: Release + +on: + push: + tags: + - '*' + +jobs: + build: + if: github.repository == 'jazzband/django-authority' + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2 + with: + fetch-depth: 0 + + - name: Set up Python + uses: actions/setup-python@v2 + with: + python-version: 3.8 + + - name: Get pip cache dir + id: pip-cache + run: | + echo "::set-output name=dir::$(pip cache dir)" + + - name: Cache + uses: actions/cache@v2 + with: + path: ${{ steps.pip-cache.outputs.dir }} + key: release-${{ hashFiles('**/setup.py') }} + restore-keys: | + release- + + - 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: Upload packages to Jazzband + if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags') + uses: pypa/gh-action-pypi-publish@master + with: + user: jazzband + password: ${{ secrets.JAZZBAND_RELEASE_KEY }} + repository_url: https://jazzband.co/projects/django-authority/upload diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index ce81867..0000000 --- a/.travis.yml +++ /dev/null @@ -1,24 +0,0 @@ -language: python -dist: xenial -python: -- 2.7 -- 3.7 -cache: pip -install: pip install tox-travis codecov -script: tox -v -after_success: codecov -jobs: - fast_finish: true - include: - - stage: deploy - python: 3.7 - deploy: - provider: pypi - user: jazzband - server: https://jazzband.co/projects/django-authority/upload - distributions: sdist bdist_wheel - password: - secure: TZJdf9naBzdkE+HDyhtoCIIc0ddEXLWW/VUD975gJUWQpOA69h4ZjCCQ6z21AZdrWczCUh6/cOLYYSoC9OeaHqF+Jzunn3iEomvdVRsW7SX7MAxTFUENQHF3S3j8fYlqIPWvNDOgxJ/AERisMUSZkRKWIYjEInYo31RoJ1ySN0w= - on: - tags: true - repo: jazzband/django-authority diff --git a/README.rst b/README.rst index 3ee1d38..62059fe 100644 --- a/README.rst +++ b/README.rst @@ -6,8 +6,9 @@ django-authority :target: https://jazzband.co/ :alt: Jazzband -.. image:: https://travis-ci.org/jazzband/django-authority.svg?branch=master - :target: https://travis-ci.org/jazzband/django-authority +.. image:: https://github.com/jazzband/django-authority/workflows/Test/badge.svg + :target: https://github.com/jazzband/django-authority/actions + :alt: GitHub Actions .. image:: https://codecov.io/gh/jazzband/django-authority/branch/master/graph/badge.svg :target: https://codecov.io/gh/jazzband/django-authority