mirror of
https://github.com/gradio-app/gradio.git
synced 2025-01-30 11:00:11 +08:00
parent
f566f80b44
commit
16782b9b1f
12
.github/actions/install-all-deps/action.yml
vendored
12
.github/actions/install-all-deps/action.yml
vendored
@ -5,6 +5,15 @@ inputs:
|
||||
always-install-pnpm:
|
||||
description: 'Dictates whether or not we should install pnpm & dependencies, regardless of the cache'
|
||||
default: false
|
||||
node_auth_token:
|
||||
description: 'Node auth token'
|
||||
default: ""
|
||||
npm_token:
|
||||
description: 'npm token'
|
||||
default: ""
|
||||
skip_build:
|
||||
description: 'Skip build'
|
||||
default: false
|
||||
|
||||
runs:
|
||||
using: "composite"
|
||||
@ -40,3 +49,6 @@ runs:
|
||||
uses: "./.github/actions/install-frontend-deps"
|
||||
with:
|
||||
always-install-pnpm: ${{ inputs.always-install-pnpm }}
|
||||
node_auth_token: ${{ inputs.node_auth_token }}
|
||||
npm_token: ${{ inputs.npm_token }}
|
||||
skip_build: ${{ inputs.skip_build }}
|
||||
|
14
.github/actions/install-frontend-deps/action.yml
vendored
14
.github/actions/install-frontend-deps/action.yml
vendored
@ -5,6 +5,15 @@ inputs:
|
||||
always-install-pnpm:
|
||||
description: 'Dictates whether or not we should install pnpm & dependencies, regardless of the cache'
|
||||
default: false
|
||||
node_auth_token:
|
||||
description: 'Node auth token'
|
||||
default: ""
|
||||
npm_token:
|
||||
description: 'npm token'
|
||||
default: ""
|
||||
skip_build:
|
||||
description: 'Skip build'
|
||||
default: false
|
||||
|
||||
runs:
|
||||
using: "composite"
|
||||
@ -25,11 +34,14 @@ runs:
|
||||
node-version: 18
|
||||
cache: pnpm
|
||||
cache-dependency-path: pnpm-lock.yaml
|
||||
env:
|
||||
NODE_AUTH_TOKEN: ${{ inputs.always-install-pnpm }}
|
||||
NPM_TOKEN: ${{ inputs.always-install-pnpm }}
|
||||
- name: Install deps
|
||||
if: steps.frontend-cache.outputs.cache-hit != 'true' || inputs.always-install-pnpm == 'true'
|
||||
shell: bash
|
||||
run: pnpm i --frozen-lockfile
|
||||
- name: Build frontend
|
||||
if: steps.frontend-cache.outputs.cache-hit != 'true'
|
||||
if: inputs.skip_build == 'false' && steps.frontend-cache.outputs.cache-hit != 'true'
|
||||
shell: bash
|
||||
run: pnpm build
|
20
.github/workflows/publish-npm.yml
vendored
20
.github/workflows/publish-npm.yml
vendored
@ -15,21 +15,13 @@ jobs:
|
||||
with:
|
||||
fetch-depth: 0
|
||||
persist-credentials: false
|
||||
- name: Setup pnpm
|
||||
uses: pnpm/action-setup@v2
|
||||
with:
|
||||
version: 8
|
||||
- name: setup node.js
|
||||
uses: actions/setup-node@v3
|
||||
with:
|
||||
cache: pnpm
|
||||
cache-dependency-path: pnpm-lock.yaml
|
||||
node-version: 18
|
||||
env:
|
||||
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
|
||||
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
|
||||
- name: install dependencies
|
||||
run: pnpm install --frozen-lockfile
|
||||
uses: "./.github/actions/install-all-deps"
|
||||
with:
|
||||
always-install-pnpm: true
|
||||
node_auth_token: ${{ secrets.NPM_TOKEN }}
|
||||
npm_token: ${{ secrets.NPM_TOKEN }}
|
||||
skip_build: 'true'
|
||||
- name: Build packages
|
||||
run: pnpm --filter @gradio/client --filter @gradio/lite build
|
||||
- name: create and publish versions
|
||||
|
@ -9,8 +9,8 @@
|
||||
"build:cdn": "vite build --mode production:cdn --emptyOutDir",
|
||||
"build:website": "vite build --mode production:website --emptyOutDir",
|
||||
"build:local": "vite build --mode production:local --emptyOutDir",
|
||||
"pybuild:gradio": "cd ../../ && rm -rf gradio/templates/frontend && python3 -m build",
|
||||
"pybuild:gradio-client": "cd ../../client/python && python3 -m build",
|
||||
"pybuild:gradio": "cd ../../ && rm -rf gradio/templates/frontend && python -m build",
|
||||
"pybuild:gradio-client": "cd ../../client/python && python -m build",
|
||||
"pybuild": "run-p pybuild:*",
|
||||
"build:lite": "pnpm pybuild && vite build --mode production:lite --emptyOutDir",
|
||||
"preview": "vite preview",
|
||||
|
Loading…
Reference in New Issue
Block a user