gradio/.github/workflows/deploy-pypi.yml

87 lines
2.8 KiB
YAML
Raw Normal View History

# 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:
workflow_dispatch:
pull_request:
types: closed
branches:
- main
paths:
- 'gradio/version.txt'
env:
NODE_OPTIONS: "--max-old-space-size=4096"
jobs:
deploy:
if: github.event.pull_request.merged == true || github.event.action == ''
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
2022-06-10 15:50:41 +08:00
- name: Install Python
uses: actions/setup-python@v3
with:
python-version: '3.x'
- name: Check new pypi version
run: python scripts/check_pypi.py
2022-06-10 15:50:41 +08:00
- name: Install pnpm
2022-06-10 15:54:36 +08:00
uses: pnpm/action-setup@v2.2.2
with:
version: 7
- name: Install build tool dependencies
run: python -m pip install build
2022-06-10 15:50:41 +08:00
- name: Build pypi package
run: |
2022-06-14 04:34:42 +08:00
export AWS_ACCESS_KEY_ID=${{ secrets.AWSACCESSKEYID }}
export AWS_SECRET_ACCESS_KEY=${{ secrets.AWSSECRETKEY }}
2022-06-14 04:39:18 +08:00
export AWS_DEFAULT_REGION=us-west-2
2022-06-14 04:34:42 +08:00
scripts/gh_action_pypi.sh
- name: Publish package
uses: pypa/gh-action-pypi-publish@27b31702a0e7fc50959f5ad993c78deac1bdfc29
with:
user: __token__
password: ${{ secrets.PYPI_API_TOKEN }}
gh-release:
needs: deploy
runs-on: ubuntu-latest
Automated Release Notes (#2306) * add changelog file * Check release notes * Fix syntax * Fix path to changelog * Use changelog * Add to changelog * Add comment * Test comment * Use txt file for comment body * Fix for multiline * rendering on website, changes to changelog * Don't use txt file * Fix pr number * merge * Split it up into two * Test fail * Follow example * Fix syntax * Delete quotes * Add syntax * Fix names * Fix syntax * Modify pr template instead and remove backticks * Check word * changelog file fixes * add 3.4 release notes to changelog * add navigation * replace pr tag and @ usernames with links * remove empty/unused sections from rendering * fix format of 3.4 notes * add releases dir and 3.0-2 notes * render from releases dir * remove changelog file * Fix RN check * Fix path * upcoming release title * switch to periods from dashes * add link to changelog in docs * Add script modify files * Modify changelog * change to release history * modify gh actions * Fix syntax * Skip draft releases during reformatting * skip template when rendering * modify upcoming.md to reflect real changes * replace links with pr tag * Add automated release notes as a new feature in upcoming * Update .github/PULL_REQUEST_TEMPLATE.md Co-authored-by: Abubakar Abid <abubakar@huggingface.co> * eUpdate website/homepage/src/style.css Co-authored-by: Abubakar Abid <abubakar@huggingface.co> * Misc fixes * one file at root * Fix Changelog check * Modify release notes format script * Fix format script + release notes * Add to contributing * Undo change to release notes from testing script * Add pr 2373 to rl * Modify file path * Update .github/PULL_REQUEST_TEMPLATE.md Co-authored-by: Abubakar Abid <abubakar@huggingface.co> * Update .github/PULL_REQUEST_TEMPLATE.md Co-authored-by: Abubakar Abid <abubakar@huggingface.co> Co-authored-by: aliabd <ali.si3luwa@gmail.com> Co-authored-by: Abubakar Abid <abubakar@huggingface.co>
2022-10-04 03:36:59 +08:00
outputs:
version: ${{ steps.set_output.outputs.version }}
steps:
- uses: actions/checkout@v3
- name: Set release name
run: echo "INPUT_NAME=v$(cat gradio/version.txt)" >> $GITHUB_ENV
- name: Release
uses: softprops/action-gh-release@v1
with:
name: ${{ env.INPUT_NAME }}
Automated Release Notes (#2306) * add changelog file * Check release notes * Fix syntax * Fix path to changelog * Use changelog * Add to changelog * Add comment * Test comment * Use txt file for comment body * Fix for multiline * rendering on website, changes to changelog * Don't use txt file * Fix pr number * merge * Split it up into two * Test fail * Follow example * Fix syntax * Delete quotes * Add syntax * Fix names * Fix syntax * Modify pr template instead and remove backticks * Check word * changelog file fixes * add 3.4 release notes to changelog * add navigation * replace pr tag and @ usernames with links * remove empty/unused sections from rendering * fix format of 3.4 notes * add releases dir and 3.0-2 notes * render from releases dir * remove changelog file * Fix RN check * Fix path * upcoming release title * switch to periods from dashes * add link to changelog in docs * Add script modify files * Modify changelog * change to release history * modify gh actions * Fix syntax * Skip draft releases during reformatting * skip template when rendering * modify upcoming.md to reflect real changes * replace links with pr tag * Add automated release notes as a new feature in upcoming * Update .github/PULL_REQUEST_TEMPLATE.md Co-authored-by: Abubakar Abid <abubakar@huggingface.co> * eUpdate website/homepage/src/style.css Co-authored-by: Abubakar Abid <abubakar@huggingface.co> * Misc fixes * one file at root * Fix Changelog check * Modify release notes format script * Fix format script + release notes * Add to contributing * Undo change to release notes from testing script * Add pr 2373 to rl * Modify file path * Update .github/PULL_REQUEST_TEMPLATE.md Co-authored-by: Abubakar Abid <abubakar@huggingface.co> * Update .github/PULL_REQUEST_TEMPLATE.md Co-authored-by: Abubakar Abid <abubakar@huggingface.co> Co-authored-by: aliabd <ali.si3luwa@gmail.com> Co-authored-by: Abubakar Abid <abubakar@huggingface.co>
2022-10-04 03:36:59 +08:00
tag_name: ${{ env.INPUT_NAME }}
- id: set_output
run: echo "::set-output name=version::${{ env.INPUT_NAME }}"
modify-release-notes:
needs: gh-release
runs-on: ubuntu-latest
if: ${{ !contains( needs.gh-release.outputs.version, 'b') }}
steps:
- uses: actions/checkout@v3
- name: Install Python
uses: actions/setup-python@v3
with:
python-version: '3.x'
- name: Set release name
run: echo "INPUT_NAME=v$(cat gradio/version.txt)" >> $GITHUB_ENV
- name: Format Release Notes for Next Release
run: python scripts/format_release_notes.py ${{ env.INPUT_NAME }}
- name: Commit files
uses: EndBug/add-and-commit@v9
with:
add: CHANGELOG.md
author_name: "GH ACTIONS"
author_email: ""