gradio/.github/workflows/publish-npm.yml
pngwn 62306d9ed1
unified release process (#4986)
* Implement unified version and release mechanism for all python and javascript packages.

* Update gradio/package.json

Co-authored-by: Abubakar Abid <abubakar@huggingface.co>

* fix changelog

* fix changelog

* Update js/button/README.md

* Update .github/workflows/generate-changeset.yml

---------

Co-authored-by: Abubakar Abid <abubakar@huggingface.co>
2023-07-21 19:13:21 +01:00

52 lines
1.5 KiB
YAML

name: Changesets
on:
push:
branches:
- main
env:
CI: true
PNPM_CACHE_FOLDER: .pnpm-store
NODE_OPTIONS: "--max-old-space-size=4096"
jobs:
version_or_publish:
runs-on: ubuntu-22.04
steps:
- name: checkout repo
uses: actions/checkout@v3
with:
fetch-depth: 0
persist-credentials: false
- name: install dependencies
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: |
. venv/bin/activate
pip install build
pnpm css
pnpm --filter @gradio/client --filter @gradio/lite build
- name: create and publish versions
id: changesets
uses: changesets/action@v1
with:
version: pnpm ci:version
commit: "chore: update versions"
title: "chore: update versions"
publish: pnpm ci:publish
env:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GRADIO_PAT }}
- name: publish to pypi
if: steps.changesets.outputs.hasChangesets != 'true'
uses: "gradio-app/github/actions/publish-pypi@main"
with:
user: __token__
passwords: |
gradio-test-pypi:${{ secrets.PYPI_API_TOKEN }}
gradio-test-client-pypi:${{ secrets.PYPI_GRADIO_CLIENT_TOKEN }}