From d13f5b9f0c1fdeed96bb3fd11fad1813c6d846a2 Mon Sep 17 00:00:00 2001 From: Crystal Xiang Date: Wed, 22 Mar 2023 13:05:16 -0700 Subject: [PATCH 1/2] add publishConfig to package.json --- .github/workflows/publish-package.yml | 2 +- package.json | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/.github/workflows/publish-package.yml b/.github/workflows/publish-package.yml index 5f6eaff..ab7be7c 100644 --- a/.github/workflows/publish-package.yml +++ b/.github/workflows/publish-package.yml @@ -18,6 +18,6 @@ jobs: # Setup .npmrc file to publish to npm registry-url: 'https://registry.npmjs.org' - run: npm i - - run: npm publish --access public + - run: npm publish env: NODE_AUTH_TOKEN: ${{ secrets.NPM_VIMEO_PUBLISH_TOKEN }} diff --git a/package.json b/package.json index 75648cb..6f4ab4b 100644 --- a/package.json +++ b/package.json @@ -10,6 +10,10 @@ "lib": "lib", "test": "test" }, + "publishConfig": { + "registry": "https://registry.npmjs.org/", + "access": "public" + }, "repository": { "type": "git", "url": "git+https://github.com/vimeo/vimeo.js.git" From 73bec1d7c29fe2b5ee18709dd0cea3794968b42b Mon Sep 17 00:00:00 2001 From: Crystal Xiang Date: Wed, 22 Mar 2023 13:47:08 -0700 Subject: [PATCH 2/2] trigger workflow on publish release --- .github/workflows/publish-package.yml | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/.github/workflows/publish-package.yml b/.github/workflows/publish-package.yml index ab7be7c..3633cb0 100644 --- a/.github/workflows/publish-package.yml +++ b/.github/workflows/publish-package.yml @@ -1,11 +1,8 @@ name: Publish Package on: - push: - branches: - - 'master' - tags: - - '*.*.*' + release: + types: [published] jobs: publish: