Skip to content

Modernize the build

Modernize the build #8

Workflow file for this run

name: Release
on:
release:
types: [published]
push:
pull_request:
jobs:
release:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
persist-credentials: false
- uses: astral-sh/setup-uv@v5
- name: Verify tag is documented
run: |
CURRENT_TAG=${GITHUB_REF#refs/tags/}
CURRENT_VERSION=$(head -n1 social_django/__init__.py | awk '{print $3}' | sed 's/[^0-9\.]//g')
if [ "${CURRENT_VERSION}" != "${CURRENT_TAG}" ]; then
echo "========================================================================"
echo "Error: tag '${CURRENT_TAG}' and version '${CURRENT_VERSION}' don't match"
echo "========================================================================"
exit 1;
fi
- name: Build dist
run: uv build
- name: Archive dist
if: github.event_name == 'release'
uses: actions/upload-artifact@v4
with:
name: dist
path: |
dist/*.tar.gz
dist/*.whl
- name: Verify long description rendering
run: uvx twine check dist/*
- name: Publish
env:
# TODO: remove once trusted publishing is configured
UV_PUBLISH_TOKEN: ${{ secrets.PYPI_API_TOKEN }}
if: github.event_name == 'release' && github.repository == 'python-social-auth/social-app-django'
run: uv publish