Add release workflow.

This commit is contained in:
Jannis Leidel 2020-11-26 09:32:28 +01:00
parent 5c2803c32c
commit 9dc0516683
No known key found for this signature in database
GPG key ID: C795956FB489DCA9
3 changed files with 56 additions and 26 deletions

53
.github/workflows/release.yml vendored Normal file
View file

@ -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

View file

@ -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

View file

@ -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