diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..d9aa279 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,53 @@ +name: Release + +on: + push: + tags: + - '*' + +jobs: + build: + if: github.repository == 'jazzband/django-axes' + 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-axes/upload diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index a774fe3..0000000 --- a/.travis.yml +++ /dev/null @@ -1,41 +0,0 @@ -dist: xenial -language: python -cache: pip -python: - - 3.6 - - 3.7 - - 3.8 - - 3.9 - - pypy3 -env: - - DJANGO=2.2 - - DJANGO=3.0 - - DJANGO=3.1 - - DJANGO=master -jobs: - fast_finish: true - allow_failures: - - env: DJANGO=master - include: - - python: 3.8 - env: TOXENV=qa - - stage: deploy - env: - python: 3.6 - script: skip - deploy: - provider: pypi - user: jazzband - server: https://jazzband.co/projects/django-axes/upload - distributions: sdist bdist_wheel - password: - secure: TCH5tGIggL2wsWce2svMwpEpPiwVOYqq1R3uSBTexszleP0OafNq/wZk2KZEReR5w1Aq68qp5F5Eeh2ZjJTq4f9M4LtTvqQzrmyNP55DYk/uB1rBJm9b4gBgMtAknxdI2g7unkhQEDo4suuPCVofM7rrDughySNpmvlUQYDttHQ= - skip_existing: true - on: - tags: true - repo: jazzband/django-axes - python: 3.6 -install: pip install tox-travis codecov -script: tox -after_success: - - codecov