Modernize the build #8
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |