From 2fd1f3e977252687c526c2c046549861f3140c6b Mon Sep 17 00:00:00 2001 From: Ali Abdalla Date: Thu, 24 Aug 2023 10:22:28 -0700 Subject: [PATCH] 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 --- .github/workflows/deploy-client-pypi.yml | 40 ----------- .github/workflows/deploy-pypi.yml | 87 ------------------------ build_pypi.sh | 2 +- scripts/gh_action_pypi.sh | 24 ------- 4 files changed, 1 insertion(+), 152 deletions(-) delete mode 100644 .github/workflows/deploy-client-pypi.yml delete mode 100644 .github/workflows/deploy-pypi.yml delete mode 100755 scripts/gh_action_pypi.sh diff --git a/.github/workflows/deploy-client-pypi.yml b/.github/workflows/deploy-client-pypi.yml deleted file mode 100644 index 11161d4d69..0000000000 --- a/.github/workflows/deploy-client-pypi.yml +++ /dev/null @@ -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 diff --git a/.github/workflows/deploy-pypi.yml b/.github/workflows/deploy-pypi.yml deleted file mode 100644 index 5106b218f6..0000000000 --- a/.github/workflows/deploy-pypi.yml +++ /dev/null @@ -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: "" \ No newline at end of file diff --git a/build_pypi.sh b/build_pypi.sh index 68a6d6e5e3..8bdede0fdb 100755 --- a/build_pypi.sh +++ b/build_pypi.sh @@ -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 diff --git a/scripts/gh_action_pypi.sh b/scripts/gh_action_pypi.sh deleted file mode 100755 index f0590e491a..0000000000 --- a/scripts/gh_action_pypi.sh +++ /dev/null @@ -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