* asd

* asd

* asd

* asd

* asd

* asd

* asd

* asd

* asd

* asd
This commit is contained in:
pngwn 2024-08-05 19:01:52 +01:00 committed by GitHub
parent 4365237599
commit f461b6ac52
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
7 changed files with 90 additions and 45 deletions

34
.config/demos.json Normal file
View File

@ -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"
]

View File

@ -66,7 +66,7 @@ runs:
- name: upload JSON - name: upload JSON
uses: actions/upload-artifact@v4 uses: actions/upload-artifact@v4
with: with:
name: output.json name: changes
path: output.json path: output.json
- name: set outputs - name: set outputs
id: pr id: pr

View File

@ -52,7 +52,8 @@ jobs:
with: with:
name: gradio-lite-${{ github.sha }} name: gradio-lite-${{ github.sha }}
path: js/lite/gradio-lite-*.tgz path: js/lite/gradio-lite-*.tgz
- name: install deps
run: python -m pip install build
- name: Build pr package - name: Build pr package
run: | 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"))' 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 - name: copy demos
uses: "gradio-app/github/actions/copy-demos@main" uses: "gradio-app/github/actions/copy-demos@main"
with: 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" gradio_client_version: "gradio-client @ git+https://github.com/gradio-app/gradio@${{ needs.changes.outputs.sha }}#subdirectory=client/python"
- name: upload demos - name: upload demos
uses: actions/upload-artifact@v4 uses: actions/upload-artifact@v4
with: with:
name: demos name: demo
path: demos/all_demos path: demo/all_demos
- name: Create JS client tarball - name: Create JS client tarball
id: create_js_tarball id: create_js_tarball
continue-on-error: true continue-on-error: true
@ -84,9 +85,3 @@ jobs:
with: with:
name: js-client-tarball name: js-client-tarball
path: ${{ steps.create_js_tarball.outputs.tarball_name }} path: ${{ steps.create_js_tarball.outputs.tarball_name }}
- name: upload storybook
uses: actions/upload-artifact@v4
with:
name: storybook-static
path: storybook-static

View File

@ -17,20 +17,28 @@ jobs:
changes: changes:
name: "changes" name: "changes"
runs-on: ubuntu-latest runs-on: ubuntu-latest
permissions:
actions: read
outputs: outputs:
should_run: ${{ steps.changes.outputs.should_run }} should_run: ${{ steps.json.outputs.should_run }}
sha: ${{ steps.changes.outputs.sha }} sha: ${{ steps.json.outputs.sha }}
pr_number: ${{ steps.changes.outputs.pr_number }} pr_number: ${{ steps.json.outputs.pr_number }}
source_branch: ${{ steps.changes.outputs.source_branch }} source_branch: ${{ steps.json.outputs.source_branch }}
source_repo: ${{ steps.changes.outputs.source_repo }} source_repo: ${{ steps.json.outputs.source_repo }}
gradio_version: ${{ steps.changes.outputs.gradio_version }} labels: ${{ steps.json.outputs.labels }}
run_id: ${{ steps.json.outputs.run_id }}
gradio_version: ${{ steps.json.outputs.gradio_version }}
steps: steps:
- uses: actions/checkout@v4 - name: Download artifact
- uses: "gradio-app/gradio/.github/actions/changes@main" uses: actions/download-artifact@v4
id: changes
with: with:
filter: "functional" name: changes
token: ${{ secrets.GITHUB_TOKEN }} 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: comment-spaces-start:
needs: changes needs: changes

View File

@ -28,8 +28,7 @@ jobs:
- name: Download artifact - name: Download artifact
uses: actions/download-artifact@v4 uses: actions/download-artifact@v4
with: with:
name: artifact-dir name: changes
path: different_dir
github-token: ${{ secrets.GITHUB_TOKEN }} github-token: ${{ secrets.GITHUB_TOKEN }}
run-id: ${{ github.event.workflow_run.id }} run-id: ${{ github.event.workflow_run.id }}
- uses: gradio-app/github/actions/json-to-output@main - uses: gradio-app/github/actions/json-to-output@main
@ -79,6 +78,8 @@ jobs:
path: storybook-static path: storybook-static
run-id: ${{ github.event.workflow_run.id }} run-id: ${{ github.event.workflow_run.id }}
github-token: ${{ secrets.GITHUB_TOKEN }} github-token: ${{ secrets.GITHUB_TOKEN }}
- name: list artifacts
run: ls -R .
- name: publish to chromatic - name: publish to chromatic
id: publish-chromatic id: publish-chromatic
uses: chromaui/action@v11 uses: chromaui/action@v11

View File

@ -48,7 +48,7 @@ jobs:
run: pnpm --filter @gradio/client build run: pnpm --filter @gradio/client build
- name: build website - name: build website
run: pnpm --filter @gradio/website build run: VERCEL=1 pnpm --filter website build
- name: upload website artifacts - name: upload website artifacts
uses: actions/upload-artifact@v4 uses: actions/upload-artifact@v4

View File

@ -2,7 +2,7 @@ name: "deploy / website"
on: on:
workflow_run: workflow_run:
workflows: ["trigger"] workflows: ["website-build"]
types: types:
- requested - requested
@ -22,22 +22,27 @@ jobs:
changes: changes:
name: "changes" name: "changes"
runs-on: ubuntu-latest runs-on: ubuntu-latest
permissions:
actions: read
outputs: outputs:
should_run: ${{ steps.changes.outputs.should_run }} should_run: ${{ steps.json.outputs.should_run }}
sha: ${{ steps.changes.outputs.sha }} sha: ${{ steps.json.outputs.sha }}
merge_sha: ${{ steps.changes.outputs.merge_sha }} pr_number: ${{ steps.json.outputs.pr_number }}
pr_number: ${{ steps.changes.outputs.pr_number }} source_branch: ${{ steps.json.outputs.source_branch }}
source_branch: ${{ steps.changes.outputs.source_branch }} source_repo: ${{ steps.json.outputs.source_repo }}
source_repo: ${{ steps.changes.outputs.source_repo }} labels: ${{ steps.json.outputs.labels }}
mergeable: ${{ steps.changes.outputs.mergeable }} run_id: ${{ steps.json.outputs.run_id }}
steps: steps:
- uses: actions/checkout@v4 - name: Download artifact
- uses: "gradio-app/gradio/.github/actions/changes@main" uses: actions/download-artifact@v4
id: changes
with: with:
type: "website" name: changes
token: ${{ secrets.GITHUB_TOKEN }} github-token: ${{ secrets.GITHUB_TOKEN }}
commit_status: false 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: comment-deploy-start:
needs: changes needs: changes
uses: "./.github/workflows/comment-queue.yml" uses: "./.github/workflows/comment-queue.yml"
@ -66,6 +71,14 @@ jobs:
with: with:
name: website-templates name: website-templates
path: js/_website/lib/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 - name: deploy json to aws
if: startsWith(needs.changes.outputs.source_branch, 'changeset-release/') && needs.changes.outputs.source_repo == 'gradio-app/gradio' 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/json/ s3://gradio-docs-json/$version/ --recursive
aws s3 cp ./js/_website/lib/templates/ s3://gradio-docs-json/$version/templates/ --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 # preview
- name: Pull Vercel Environment Information - name: Pull Vercel Environment Information
shell: bash shell: bash