Force update of some stubs from typeshed to PyPI #51
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: Force update of some stubs from typeshed to PyPI | |
on: | |
workflow_dispatch: | |
inputs: | |
distribution: | |
description: 'Package name or pattern (Python regexp)' | |
required: true | |
env: | |
FORCE_COLOR: 1 | |
jobs: | |
build-and-upload: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Setup Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: '3.12' | |
- name: Checkout main | |
uses: actions/checkout@v4 | |
with: | |
path: main | |
- name: Checkout typeshed | |
uses: actions/checkout@v4 | |
with: | |
repository: python/typeshed | |
path: typeshed | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install -r main/requirements.txt | |
- name: Execute build and upload | |
env: | |
TWINE_USERNAME: __token__ | |
TWINE_PASSWORD: ${{ secrets.TYPESHED_BOT_API_TOKEN }} | |
run: | | |
cd main | |
python -m stub_uploader.upload_some ../typeshed "${{ github.event.inputs.distribution }}" | |
# If we are force uploading packages that were never uploaded, they are added to the list | |
if [ -z "$(git status --porcelain)" ]; then | |
exit 0; | |
fi | |
git config user.name github-actions && git config user.email github-actions@github.com | |
git add . && git commit -m "Update uploaded packages list" && git push |