gradio/.github/workflows/publish-npm.yml

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

52 lines
1.7 KiB
YAML
Raw Normal View History

name: Changesets
on:
push:
branches:
- main
env:
CI: true
PNPM_CACHE_FOLDER: .pnpm-store
jobs:
version:
runs-on: ubuntu-latest
steps:
- name: checkout code repository
uses: actions/checkout@v3
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
2023-05-13 03:40:54 +08:00
run: pnpm install --frozen-lockfile
- name: Build packages
2023-06-29 20:25:29 +08:00
run: pnpm --filter @gradio/client --filter @gradio/lite build
- name: create and publish versions
id: changesets
uses: changesets/action@v1
with:
2023-05-13 03:21:58 +08:00
version: pnpm ci:version
commit: "chore: update versions"
title: "chore: update versions"
2023-03-22 22:42:58 +08:00
publish: pnpm ci:publish
env:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GRADIO_PAT }}
- name: label PR
if: ${{ steps.changesets.outputs.pullRequestNumber != '' && steps.changesets.outputs.pullRequestNumber != 'undefined' }}
run: gh pr edit "$PR_NUMBER" --add-label "no-changelog-update"
env:
PR_NUMBER: ${{ steps.changesets.outputs.pullRequestNumber }}
GITHUB_TOKEN: ${{ secrets.GRADIO_PAT }} # Not sure if this one is required