From 41ea400db0d5b5bdc879542ce7761b42e89a5c58 Mon Sep 17 00:00:00 2001 From: Hannah Date: Fri, 24 May 2024 09:51:22 +0100 Subject: [PATCH] Include JS Client package in CI for PR testing (#8362) * add js client pkg action * test * Revert "test" This reverts commit 575bcfca1b67ef8148e2f91a8cd5545593e7af3a. --- .github/workflows/deploy-spaces.yml | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/.github/workflows/deploy-spaces.yml b/.github/workflows/deploy-spaces.yml index bc7d0967d8..51c5978841 100644 --- a/.github/workflows/deploy-spaces.yml +++ b/.github/workflows/deploy-spaces.yml @@ -49,6 +49,7 @@ jobs: outputs: space_url: ${{ steps.upload-demo.outputs.SPACE_URL }} gradio_version: ${{ steps.get_gradio_version.outputs.gradio_version }} + js_tarball_url: ${{ steps.upload_js_tarball.outputs.js_tarball_url }} needs: changes if: ${{ needs.changes.outputs.should_run == 'true' }} runs-on: ubuntu-latest @@ -100,6 +101,19 @@ jobs: export AWS_SECRET_ACCESS_KEY=${{ secrets.PR_DEPLOY_SECRET }} export AWS_DEFAULT_REGION=us-east-1 aws s3 cp dist/gradio-${{ steps.get_gradio_version.outputs.GRADIO_VERSION }}-py3-none-any.whl s3://gradio-builds/${{ needs.changes.outputs.sha }}/ + - name: Build JS Client package + run: | + cd client/js + npm pack + - name: Upload JS Client Tarball to S3 + id: upload_js_tarball + run: | + export AWS_ACCESS_KEY_ID=${{ secrets.PR_DEPLOY_KEY }} + export AWS_SECRET_ACCESS_KEY=${{ secrets.PR_DEPLOY_SECRET }} + export AWS_DEFAULT_REGION=us-east-1 + tarball_name=$(ls gradio-client-*.tgz) + aws s3 cp $tarball_name s3://gradio-builds/${{ needs.changes.outputs.sha }}/$tarball_name + echo "js_tarball_url=https://gradio-builds.s3.amazonaws.com/${{ needs.changes.outputs.sha }}/$tarball_name" >> $GITHUB_OUTPUT - name: Install Hub Client Library run: pip install huggingface-hub - name: Upload demo to spaces @@ -143,6 +157,11 @@ jobs: ```bash pip install "gradio-client @ git+https://github.com/gradio-app/gradio@${{ needs.changes.outputs.sha }}#subdirectory=client/python" ``` + + **Install Gradio JS Client from this PR** + ```bash + npm install ${{ needs.deploy-spaces.outputs.js_tarball_url }} + ``` comment-spaces-failure: uses: "./.github/workflows/comment-queue.yml" needs: [deploy-spaces, changes]