Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: modernize release process #954

Merged
merged 1 commit into from
Jan 6, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 13 additions & 17 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,26 +3,20 @@ name: Release
on:
release:
types: [published]
push:
pull_request:

jobs:
release:
runs-on: ubuntu-latest
permissions:
id-token: write
steps:
- uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.9'
cache: pip
cache-dependency-path: requirements*.txt

- name: Install Python dependencies
run: |
python -m pip install --upgrade pip
pip install wheel twine
- uses: astral-sh/setup-uv@v5

- name: Verify tag is documented
if: github.event_name == 'release'
run: |
CURRENT_TAG=${GITHUB_REF#refs/tags/}
CURRENT_VERSION=$(head -n1 social_core/__init__.py | awk '{print $3}' | sed 's/[^0-9\.]//g')
Expand All @@ -34,9 +28,10 @@ jobs:
fi

- name: Build dist
run: python setup.py sdist bdist_wheel --python-tag py3
run: uv build

- name: Archive dist
if: github.event_name == 'release'
uses: actions/upload-artifact@v4
with:
name: dist
Expand All @@ -45,10 +40,11 @@ jobs:
dist/*.whl

- name: Verify long description rendering
run: twine check dist/*
run: uvx twine check dist/*

- name: Publish
env:
PYPI_API_TOKEN: ${{ secrets.PYPI_API_TOKEN }}
run: |
twine upload --non-interactive -u __token__ -p "${PYPI_API_TOKEN}" dist/*
# 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-core'
run: uv publish
Loading