mirror of
https://github.com/gradio-app/gradio.git
synced 2025-03-19 12:00:39 +08:00
Add ignore scripts to pnpm i in pypi action (#5316)
* add json generation to prepare * add changeset * remove pnpm prepare * add changeset * bring back prepare, add ignore scripts * delete changeset * add to right commadn * add frozen lockfile to gh_action_pypi * remove unused gh_action_pypi script * remove unused scripts --------- Co-authored-by: gradio-pr-bot <gradio-pr-bot@users.noreply.github.com>
This commit is contained in:
parent
d44708e243
commit
2fd1f3e977
40
.github/workflows/deploy-client-pypi.yml
vendored
40
.github/workflows/deploy-client-pypi.yml
vendored
@ -1,40 +0,0 @@
|
||||
# This workflow will upload a Python Package 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 Gradio Client Python Package
|
||||
|
||||
on:
|
||||
workflow_dispatch:
|
||||
pull_request:
|
||||
types: closed
|
||||
branches:
|
||||
- main
|
||||
paths:
|
||||
- 'client/python/gradio_client/version.txt'
|
||||
|
||||
jobs:
|
||||
deploy:
|
||||
if: github.event.pull_request.merged == true || github.event.action == ''
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- name: Install Python
|
||||
uses: actions/setup-python@v4
|
||||
with:
|
||||
python-version: '3.x'
|
||||
- name: Check new pypi version
|
||||
run: python client/python/scripts/check_pypi.py
|
||||
- name: Build pypi package
|
||||
run: |
|
||||
client/python/scripts/build_pypi.sh
|
||||
- name: Publish package
|
||||
uses: pypa/gh-action-pypi-publish@release/v1
|
||||
with:
|
||||
user: __token__
|
||||
password: ${{ secrets.PYPI_GRADIO_CLIENT_TOKEN }}
|
||||
packages-dir: client/python/dist
|
87
.github/workflows/deploy-pypi.yml
vendored
87
.github/workflows/deploy-pypi.yml
vendored
@ -1,87 +0,0 @@
|
||||
# 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
|
||||
- name: Install Python
|
||||
uses: actions/setup-python@v4
|
||||
with:
|
||||
python-version: '3.x'
|
||||
- name: Check new pypi version
|
||||
run: python scripts/check_pypi.py
|
||||
- name: Install pnpm
|
||||
uses: pnpm/action-setup@v2
|
||||
with:
|
||||
version: 8
|
||||
- name: Install build tool dependencies
|
||||
run: python -m pip install build
|
||||
- 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@release/v1
|
||||
with:
|
||||
user: __token__
|
||||
password: ${{ secrets.PYPI_API_TOKEN }}
|
||||
gh-release:
|
||||
needs: deploy
|
||||
runs-on: ubuntu-latest
|
||||
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 }}
|
||||
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@v4
|
||||
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: ""
|
@ -13,7 +13,7 @@ GRADIO_VERSION=$new_version
|
||||
|
||||
rm -rf gradio/templates/frontend
|
||||
rm -rf gradio/templates/cdn
|
||||
pnpm i
|
||||
pnpm i --frozen-lockfile --ignore-scripts
|
||||
GRADIO_VERSION=$new_version pnpm build
|
||||
GRADIO_VERSION=$new_version pnpm build:cdn
|
||||
aws s3 cp gradio/templates/cdn "s3://gradio/${new_version}/" --recursive
|
||||
|
@ -1,24 +0,0 @@
|
||||
#!/bin/bash
|
||||
set -e
|
||||
|
||||
cd "$(dirname ${0})/.."
|
||||
source scripts/helpers.sh
|
||||
|
||||
pnpm_required
|
||||
aws_required
|
||||
|
||||
# You should update the version in version.txt before running this script
|
||||
new_version="$(cat gradio/version.txt)"
|
||||
GRADIO_VERSION=$new_version
|
||||
|
||||
rm -rf gradio/templates/frontend
|
||||
rm -rf gradio/templates/cdn
|
||||
pnpm i
|
||||
GRADIO_VERSION=$new_version pnpm build
|
||||
GRADIO_VERSION=$new_version pnpm build:cdn
|
||||
aws s3 cp gradio/templates/cdn "s3://gradio/${new_version}/" --recursive
|
||||
cp gradio/templates/cdn/index.html gradio/templates/frontend/share.html
|
||||
|
||||
rm -rf dist/*
|
||||
rm -rf build/*
|
||||
python3 -m build
|
Loading…
x
Reference in New Issue
Block a user