From 57a0aa194f128880b75d80181f4af3488f99248a Mon Sep 17 00:00:00 2001 From: pngwn Date: Wed, 22 Mar 2023 17:53:35 +0000 Subject: [PATCH] fix npm publish (#3582) * fix npm publish * correct repo name --- .github/workflows/publish-npm.yml | 20 ++++++++++++-------- ui/.changeset/config.json | 7 +++++-- ui/package.json | 3 ++- ui/pnpm-lock.yaml | 30 ++++++++++++++++++++++++++++++ 4 files changed, 49 insertions(+), 11 deletions(-) diff --git a/.github/workflows/publish-npm.yml b/.github/workflows/publish-npm.yml index 39e7100526..deedf11406 100644 --- a/.github/workflows/publish-npm.yml +++ b/.github/workflows/publish-npm.yml @@ -17,18 +17,21 @@ jobs: uses: actions/checkout@v3 with: fetch-depth: 0 + - name: Setup pnpm + uses: pnpm/action-setup@v2.2.4 + with: + version: 7 - name: setup node.js uses: actions/setup-node@v3 with: - node-version: 16 - - name: install pnpm - run: npm i pnpm@latest -g - - name: Setup npmrc - run: echo "//registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN }}" > .npmrc - - name: setup pnpm config - run: pnpm config set store-dir $PNPM_CACHE_FOLDER + cache: pnpm + cache-dependency-path: ui/pnpm-lock.yaml + node-version: 18 + registry-url: "https://registry.npmjs.org" - name: install dependencies run: pnpm install + - name: Setup npmrc + run: echo "//registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN }}" > .npmrc - name: create and publish versions uses: changesets/action@v1 with: @@ -36,6 +39,7 @@ jobs: commit: "chore: update versions" title: "chore: update versions" publish: pnpm ci:publish - cwd: ./ui + cwd: ui env: + NPM_TOKEN: ${{ secrets.NPM_TOKEN }} GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} \ No newline at end of file diff --git a/ui/.changeset/config.json b/ui/.changeset/config.json index c992ff3999..e78f384f5d 100644 --- a/ui/.changeset/config.json +++ b/ui/.changeset/config.json @@ -1,10 +1,13 @@ { "$schema": "https://unpkg.com/@changesets/config@2.3.0/schema.json", - "changelog": "@changesets/cli/changelog", + "changelog": [ + "@changesets/changelog-github", + { "repo": "gradio-app/gradio" } + ], "commit": false, "fixed": [], "linked": [], - "access": "restricted", + "access": "public", "baseBranch": "main", "updateInternalDependencies": "patch", "ignore": [] diff --git a/ui/package.json b/ui/package.json index 877347db34..1f803f8831 100644 --- a/ui/package.json +++ b/ui/package.json @@ -21,13 +21,14 @@ "test:browser": "pnpm --filter @gradio/app test:browser:full", "test:browser:full": "run-s build test:browser", "test:browser:debug": "pnpm --filter @gradio/app test:browser:debug", - "ci:publish": "pnpm publish -r" + "ci:publish": "pnpm publish --no-git-checks --access public -r" }, "type": "module", "author": "", "license": "ISC", "private": true, "dependencies": { + "@changesets/changelog-github": "^0.4.8", "@changesets/cli": "^2.26.1", "@gradio/tootils": "workspace:^0.0.1", "@playwright/test": "^1.27.1", diff --git a/ui/pnpm-lock.yaml b/ui/pnpm-lock.yaml index a91e9d9a50..8bd3955b20 100644 --- a/ui/pnpm-lock.yaml +++ b/ui/pnpm-lock.yaml @@ -4,6 +4,7 @@ importers: .: specifiers: + '@changesets/changelog-github': ^0.4.8 '@changesets/cli': ^2.26.1 '@gradio/tootils': workspace:^0.0.1 '@playwright/test': ^1.27.1 @@ -43,6 +44,7 @@ importers: vite: ^2.9.5 vitest: ^0.12.7 dependencies: + '@changesets/changelog-github': 0.4.8 '@changesets/cli': 2.26.1 '@gradio/tootils': link:packages/tootils '@playwright/test': 1.27.1 @@ -630,6 +632,16 @@ packages: '@changesets/types': 5.2.1 dev: false + /@changesets/changelog-github/0.4.8: + resolution: {integrity: sha512-jR1DHibkMAb5v/8ym77E4AMNWZKB5NPzw5a5Wtqm1JepAuIF+hrKp2u04NKM14oBZhHglkCfrla9uq8ORnK/dw==} + dependencies: + '@changesets/get-github-info': 0.5.2 + '@changesets/types': 5.2.1 + dotenv: 8.6.0 + transitivePeerDependencies: + - encoding + dev: false + /@changesets/cli/2.26.1: resolution: {integrity: sha512-XnTa+b51vt057fyAudvDKGB0Sh72xutQZNAdXkCqPBKO2zvs2yYZx5hFZj1u9cbtpwM6Sxtcr02/FQJfZOzemQ==} hasBin: true @@ -697,6 +709,15 @@ packages: semver: 5.7.1 dev: false + /@changesets/get-github-info/0.5.2: + resolution: {integrity: sha512-JppheLu7S114aEs157fOZDjFqUDpm7eHdq5E8SSR0gUBTEK0cNSHsrSR5a66xs0z3RWuo46QvA3vawp8BxDHvg==} + dependencies: + dataloader: 1.4.0 + node-fetch: 2.6.7 + transitivePeerDependencies: + - encoding + dev: false + /@changesets/get-release-plan/3.0.16: resolution: {integrity: sha512-OpP9QILpBp1bY2YNIKFzwigKh7Qe9KizRsZomzLe6pK8IUo8onkAAVUD8+JRKSr8R7d4+JRuQrfSSNlEwKyPYg==} dependencies: @@ -2205,6 +2226,10 @@ packages: engines: {node: '>=4'} dev: false + /dataloader/1.4.0: + resolution: {integrity: sha512-68s5jYdlvasItOJnCuI2Q9s4q98g0pCyL3HrcKJu8KNugUl8ahgmZYg38ysLTgQjjXX3H8CJLkAvWrclWfcalw==} + dev: false + /debug/4.3.4: resolution: {integrity: sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==} engines: {node: '>=6.0'} @@ -2337,6 +2362,11 @@ packages: domhandler: 4.3.1 dev: false + /dotenv/8.6.0: + resolution: {integrity: sha512-IrPdXQsk2BbzvCBGBOTmmSH5SodmqZNt4ERAZDmW4CT+tL8VtvinqywuANaFu4bOMWki16nqf0e4oC0QIaDr/g==} + engines: {node: '>=10'} + dev: false + /electron-to-chromium/1.4.59: resolution: {integrity: sha512-AOJ3cAE0TWxz4fQ9zkND5hWrQg16nsZKVz9INOot1oV//u4wWu5xrj9CQMmPTYskkZRunSRc9sAnr4EkexXokg==} dev: true