| 1 |
name: Release |
| 2 |
|
| 3 |
on: |
| 4 |
push: |
| 5 |
tags: |
| 6 |
- '*' |
| 7 |
|
| 8 |
jobs: |
| 9 |
build: |
| 10 |
if: github.repository == 'jazzband/django-model-utils' |
| 11 |
runs-on: ubuntu-latest |
| 12 |
|
| 13 |
steps: |
| 14 |
- uses: actions/checkout@v3 |
| 15 |
with: |
| 16 |
fetch-depth: 0 |
| 17 |
|
| 18 |
- name: Set up Python |
| 19 |
uses: actions/setup-python@v4 |
| 20 |
with: |
| 21 |
python-version: 3.x |
| 22 |
|
| 23 |
- name: Install dependencies |
| 24 |
run: | |
| 25 |
python -m pip install -U pip |
| 26 |
python -m pip install -U setuptools twine wheel |
| 27 |
|
| 28 |
- name: Build package |
| 29 |
run: | |
| 30 |
python setup.py --version |
| 31 |
python setup.py sdist --format=gztar bdist_wheel |
| 32 |
twine check dist/* |
| 33 |
|
| 34 |
- name: Upload packages to Jazzband |
| 35 |
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags') |
| 36 |
uses: pypa/gh-action-pypi-publish@master |
| 37 |
with: |
| 38 |
user: jazzband |
| 39 |
password: ${{ secrets.JAZZBAND_RELEASE_KEY }} |
| 40 |
repository_url: https://jazzband.co/projects/django-model-utils/upload |