gradio/.github/workflows/deploy-pypi.yml
2022-06-13 13:39:18 -07:00

50 lines
1.4 KiB
YAML

# This workflow will upload a Python Package using Twine when a release is created
# For more information see: https://help.github.com/en/actions/language-and-framework-guides/using-python-with-github-actions#publishing-to-package-registries
# This workflow uses actions that are not certified by GitHub.
# They are provided by a third-party and are governed by
# separate terms of service, privacy policy, and support
# documentation.
name: Upload Python Package
on:
pull_request:
types: closed
branches:
- main
- release**
paths:
- 'gradio/version.txt'
permissions:
contents: read
jobs:
deploy:
if: github.event.pull_request.merged == true
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Install Python
uses: actions/setup-python@v3
with:
python-version: '3.x'
- name: Install pnpm
uses: pnpm/action-setup@v2.2.2
with:
version: 6.32.11
- name: Install pip
run: python -m pip install pip wheel
- name: Build pypi package
run: |
export AWS_ACCESS_KEY_ID=${{ secrets.AWSACCESSKEYID }}
export AWS_SECRET_ACCESS_KEY=${{ secrets.AWSSECRETKEY }}
export AWS_DEFAULT_REGION=us-west-2
scripts/gh_action_pypi.sh
- name: Publish package
uses: pypa/gh-action-pypi-publish@27b31702a0e7fc50959f5ad993c78deac1bdfc29
with:
user: __token__
password: ${{ secrets.PYPI_API_TOKEN }}