diff --git a/.config/demos.json b/.config/demos.json new file mode 100644 index 0000000000..d532f2a348 --- /dev/null +++ b/.config/demos.json @@ -0,0 +1,34 @@ +[ + "audio_debugger", + "blocks_essay", + "blocks_group", + "blocks_js_methods", + "blocks_layout", + "blocks_multiple_event_triggers", + "blocks_update", + "calculator", + "cancel_events", + "chatbot_multimodal", + "chatinterface_streaming_echo", + "clear_components", + "code", + "fake_gan", + "fake_diffusion_with_gif", + "file_explorer_component_events", + "image_mod_default_image", + "image_editor_events", + "image_segmentation", + "interface_random_slider", + "kitchen_sink", + "kitchen_sink_random", + "matrix_transpose", + "mini_leaderboard", + "model3D", + "native_plots", + "reverse_audio", + "stt_or_tts", + "stream_audio", + "stream_frames", + "video_component", + "zip_files" +] diff --git a/.github/actions/changes/action.yml b/.github/actions/changes/action.yml index 477143781a..035d9b3477 100644 --- a/.github/actions/changes/action.yml +++ b/.github/actions/changes/action.yml @@ -66,7 +66,7 @@ runs: - name: upload JSON uses: actions/upload-artifact@v4 with: - name: output.json + name: changes path: output.json - name: set outputs id: pr diff --git a/.github/workflows/previews-build.yml b/.github/workflows/previews-build.yml index 574ee714fa..c540447135 100644 --- a/.github/workflows/previews-build.yml +++ b/.github/workflows/previews-build.yml @@ -52,7 +52,8 @@ jobs: with: name: gradio-lite-${{ github.sha }} path: js/lite/gradio-lite-*.tgz - + - name: install deps + run: python -m pip install build - name: Build pr package run: | python -c 'import json; j = json.load(open("gradio/package.json")); j["version"] = "${{ needs.changes.outputs.gradio_version }}"; json.dump(j, open("gradio/package.json", "w"))' @@ -65,13 +66,13 @@ jobs: - name: copy demos uses: "gradio-app/github/actions/copy-demos@main" with: - gradio_version: "https://gradio-builds.s3.amazonaws.com/${{ needs.changes.outputs.sha }}/gradio-${{ needs.changes.outputs.gradio_version }}-py3-none-any.whl" + gradio_version: "https://gradio-pypi-previews.s3.amazonaws.com/${{ needs.changes.outputs.sha }}/gradio-${{ needs.changes.outputs.gradio_version }}-py3-none-any.whl" gradio_client_version: "gradio-client @ git+https://github.com/gradio-app/gradio@${{ needs.changes.outputs.sha }}#subdirectory=client/python" - name: upload demos uses: actions/upload-artifact@v4 with: - name: demos - path: demos/all_demos + name: demo + path: demo/all_demos - name: Create JS client tarball id: create_js_tarball continue-on-error: true @@ -84,9 +85,3 @@ jobs: with: name: js-client-tarball path: ${{ steps.create_js_tarball.outputs.tarball_name }} - - - name: upload storybook - uses: actions/upload-artifact@v4 - with: - name: storybook-static - path: storybook-static diff --git a/.github/workflows/previews-deploy.yml b/.github/workflows/previews-deploy.yml index aa9a8f78df..54b57768f0 100644 --- a/.github/workflows/previews-deploy.yml +++ b/.github/workflows/previews-deploy.yml @@ -17,20 +17,28 @@ jobs: changes: name: "changes" runs-on: ubuntu-latest + permissions: + actions: read outputs: - should_run: ${{ steps.changes.outputs.should_run }} - sha: ${{ steps.changes.outputs.sha }} - pr_number: ${{ steps.changes.outputs.pr_number }} - source_branch: ${{ steps.changes.outputs.source_branch }} - source_repo: ${{ steps.changes.outputs.source_repo }} - gradio_version: ${{ steps.changes.outputs.gradio_version }} + should_run: ${{ steps.json.outputs.should_run }} + sha: ${{ steps.json.outputs.sha }} + pr_number: ${{ steps.json.outputs.pr_number }} + source_branch: ${{ steps.json.outputs.source_branch }} + source_repo: ${{ steps.json.outputs.source_repo }} + labels: ${{ steps.json.outputs.labels }} + run_id: ${{ steps.json.outputs.run_id }} + gradio_version: ${{ steps.json.outputs.gradio_version }} steps: - - uses: actions/checkout@v4 - - uses: "gradio-app/gradio/.github/actions/changes@main" - id: changes + - name: Download artifact + uses: actions/download-artifact@v4 with: - filter: "functional" - token: ${{ secrets.GITHUB_TOKEN }} + name: changes + github-token: ${{ secrets.GITHUB_TOKEN }} + run-id: ${{ github.event.workflow_run.id }} + - uses: gradio-app/github/actions/json-to-output@main + id: json + with: + path: output.json comment-spaces-start: needs: changes diff --git a/.github/workflows/storybook-deploy.yml b/.github/workflows/storybook-deploy.yml index dd5606b7e6..3fbe31e8ef 100644 --- a/.github/workflows/storybook-deploy.yml +++ b/.github/workflows/storybook-deploy.yml @@ -28,8 +28,7 @@ jobs: - name: Download artifact uses: actions/download-artifact@v4 with: - name: artifact-dir - path: different_dir + name: changes github-token: ${{ secrets.GITHUB_TOKEN }} run-id: ${{ github.event.workflow_run.id }} - uses: gradio-app/github/actions/json-to-output@main @@ -79,6 +78,8 @@ jobs: path: storybook-static run-id: ${{ github.event.workflow_run.id }} github-token: ${{ secrets.GITHUB_TOKEN }} + - name: list artifacts + run: ls -R . - name: publish to chromatic id: publish-chromatic uses: chromaui/action@v11 diff --git a/.github/workflows/website-build.yml b/.github/workflows/website-build.yml index 8be6129a1d..05ac7a70d3 100644 --- a/.github/workflows/website-build.yml +++ b/.github/workflows/website-build.yml @@ -48,7 +48,7 @@ jobs: run: pnpm --filter @gradio/client build - name: build website - run: pnpm --filter @gradio/website build + run: VERCEL=1 pnpm --filter website build - name: upload website artifacts uses: actions/upload-artifact@v4 diff --git a/.github/workflows/website-deploy.yml b/.github/workflows/website-deploy.yml index a2ede77cb5..9557aeee8a 100644 --- a/.github/workflows/website-deploy.yml +++ b/.github/workflows/website-deploy.yml @@ -2,7 +2,7 @@ name: "deploy / website" on: workflow_run: - workflows: ["trigger"] + workflows: ["website-build"] types: - requested @@ -22,22 +22,27 @@ jobs: changes: name: "changes" runs-on: ubuntu-latest + permissions: + actions: read outputs: - should_run: ${{ steps.changes.outputs.should_run }} - sha: ${{ steps.changes.outputs.sha }} - merge_sha: ${{ steps.changes.outputs.merge_sha }} - pr_number: ${{ steps.changes.outputs.pr_number }} - source_branch: ${{ steps.changes.outputs.source_branch }} - source_repo: ${{ steps.changes.outputs.source_repo }} - mergeable: ${{ steps.changes.outputs.mergeable }} + should_run: ${{ steps.json.outputs.should_run }} + sha: ${{ steps.json.outputs.sha }} + pr_number: ${{ steps.json.outputs.pr_number }} + source_branch: ${{ steps.json.outputs.source_branch }} + source_repo: ${{ steps.json.outputs.source_repo }} + labels: ${{ steps.json.outputs.labels }} + run_id: ${{ steps.json.outputs.run_id }} steps: - - uses: actions/checkout@v4 - - uses: "gradio-app/gradio/.github/actions/changes@main" - id: changes + - name: Download artifact + uses: actions/download-artifact@v4 with: - type: "website" - token: ${{ secrets.GITHUB_TOKEN }} - commit_status: false + name: changes + github-token: ${{ secrets.GITHUB_TOKEN }} + run-id: ${{ github.event.workflow_run.id }} + - uses: gradio-app/github/actions/json-to-output@main + id: json + with: + path: output.json comment-deploy-start: needs: changes uses: "./.github/workflows/comment-queue.yml" @@ -66,6 +71,14 @@ jobs: with: name: website-templates path: js/_website/lib/templates + - name: download website artifacts + uses: actions/download-artifact@v4 + with: + name: website + path: js/_website/.vercel + + - name: list files + run: ls -R . - name: deploy json to aws if: startsWith(needs.changes.outputs.source_branch, 'changeset-release/') && needs.changes.outputs.source_repo == 'gradio-app/gradio' @@ -77,12 +90,6 @@ jobs: aws s3 cp ./js/_website/lib/json/ s3://gradio-docs-json/$version/ --recursive aws s3 cp ./js/_website/lib/templates/ s3://gradio-docs-json/$version/templates/ --recursive - - name: download website artifacts - uses: actions/download-artifact@v4 - with: - name: website - path: js/_website/.vercel - # preview - name: Pull Vercel Environment Information shell: bash